* lisp.h (toplevel): Add comment about using Lisp_Save_Value
[bpt/emacs.git] / src / ChangeLog
CommitLineData
468afbac
DA
12013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2
3 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
4 objects, related functions and macros.
5 (make_save_value): Adjust prototype.
6 (make_save_pointer): New prototype.
7 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
8 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
9 * alloc.c (format_save_value): Rename to make_save_value.
10 (make_save_pointer): New function.
11 (record_xmalloc): Use make_save_pointer.
12 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
13 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
14 Change users of make_save_value to make_save_pointer.
15 Likewise for format_save_value and make_save_value.
16
0e70695a
DA
172013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
18
19 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
20 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
21 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
22 debugging stubs.
23
963ea40f
PE
242013-01-15 Paul Eggert <eggert@cs.ucla.edu>
25
26 * alloc.c (free_save_value): Now static.
27
3346c1d0
DA
282013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
29
30 * keymap.c (map_keymap_internal): Use format_save_value.
31 (map_keymap_char_table_item): Adjust accordingly.
32 * fileio.c (non_regular_fd, non_regular_inserted)
33 (non_regular_nbytes): Remove.
34 (Finsert_file_contents): Convert trytry to ptrdiff_t. Use
35 format_save_value to pass parameters to read_non_regular.
36 (read_non_regular): Use XSAVE_ macros to extract parameters.
37 Adjust comment.
38 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
39 format_save_value.
40 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
41
2b30549c
DA
422013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
43
44 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
45 extraction from any Lisp_Save_Value slot. Add type checking.
46 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
47 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
48 * xselect.c: All users changed.
49
1b971ac1
DA
502013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
51
52 Some convenient bits to deal with Lisp_Save_Values.
53 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
54 (allocate_misc): Remove prototype.
55 (format_save_value): New prototype.
56 * alloc.c (allocate_misc): Revert back to static.
57 (format_save_value): New function to build Lisp_Save_Value
58 object with the specified internal structure.
59 (make_save_value): Reimplement using format_save_value.
60 * editfns.c (save_excursion_save): Use format_save_value.
61 (save_excursion_restore): Use XSAVE_OBJECT.
62
c50cf2ea
PE
632013-01-14 Paul Eggert <eggert@cs.ucla.edu>
64
65 Avoid needless casts with XSAVE_POINTER.
66 * alloc.c (mark_object) [GC_MARK_STACK]:
67 * dired.c (directory_files_internal_unwind):
68 * fileio.c (do_auto_save_unwind):
69 * gtkutil.c (pop_down_dialog):
70 * keymap.c (map_keymap_char_table_item):
71 * lread.c (load_unwind):
72 * nsmenu.m (pop_down_menu):
73 * print.c (print_object) [GC_MARK_STACK]:
74 * xfns.c (clean_up_file_dialog):
75 * xmenu.c (cleanup_widget_value_tree):
76 Omit casts between XSAVE_POINTER and a pointer type.
77
9d5a1260
DA
782013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
79
80 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
81 * eval.c (eval_sub): Protect `form' from being GCed before its
82 car and cdr becomes protected with the backtrace entry.
83
73ebd38f
DA
842013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
85
86 Make Lisp_Save_Value more versatile storage for up to four objects.
87 * lisp.h (toplevel): Enumeration to describe types of saved objects.
88 (struct Lisp_Save_Value): New layout. Adjust comments.
89 (XSAVE_POINTER): New macro.
90 (XSAVE_INTEGER): Likewise.
91 (allocate_misc): Add prototype.
92 (free_misc): Likewise.
93 * alloc.c (allocate_misc): Now global.
94 (free_misc): Likewise. Adjust comment.
95 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
96 (free_save_value): Likewise.
97 (mark_object): Likewise.
98 * editfns.c (save_excursion_save): Pack everything within
99 Lisp_Save_Value and so avoid xmalloc.
100 (save_excursion_restore): Adjust to match new layout. Use free_misc
101 because we do not allocate extra memory any more. Add eassert.
102 * print.c (print_object): New code to print Lisp_Save_Value. Do not
103 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
104 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
105 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
106 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
107
b826986f
JD
1082013-01-13 Jan Djärv <jan.h.d@swipnet.se>
109
110 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
111 (nsfont_draw): Remove disabling of LCD smoothing.
112 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2e7a1892 113 Bug#11484 with LCD smoothing on.
b826986f 114
c0511b57 1152013-01-13 Paul Eggert <eggert@cs.ucla.edu>
45b7bfdd 116
b6f960a0
PE
117 Fix SIGDANGER handlers, for AIX (Bug#13408).
118 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
119 Move handlers here from emacs.c; they were out of place.
120
616763d5
JD
1212013-01-11 Jan Djärv <jan.h.d@swipnet.se>
122
123 * xterm.c (syms_of_xterm): Adjust documentation for
124 scroll-bar-adjust-thumb-portion.
125
0b59090b 1262012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
ec782c5f
JD
127
128 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
129 determine whether scroll bar thumb size should be adjusted or
130 not. Use variable for MOTIF.
131
132 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
133 GTK.
134
7bc916b4
JD
1352013-01-13 Jan Djärv <jan.h.d@swipnet.se>
136
eac4d08f
JD
137 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
138 event is generated.
139 (doCommandBySelector:): Set processingCompose to NO.
140
7bc916b4
JD
141 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
142 Remove check for fkeys count > zero, block/unblock fixes the real bug.
143 (nsfont_list_family): Add block/unblock_input calls.
144 (nsfont_open): Move block_input earlier. Add unblock_input before early
145 return.
146 (nsfont_draw): Add block/unblock_input calls.
147
bdc9b756
PE
1482013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
149
150 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
151 for old_charpos and old_bytepos.
152
ee56a6dc
PE
1532013-01-12 Paul Eggert <eggert@cs.ucla.edu>
154
155 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
156 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
157 Clear tzvalbuf_in_environ if this workaround is in effect.
158 Problem and fix reported by Kazuhiro Ito.
159
9fc9a531
AH
1602013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
161
162 * insdel.c (Fcombine_after_change_execute, syms_of_insdel): Fix
163 ambiguous doc string cross-reference(s).
164
165 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
166 doc string cross-reference(s).
167
168 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
169 string cross-reference(s).
170
6020559a
DA
1712013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
172
173 Avoid unnecessary byte position calculation for the gap movement.
174 Since all users of move_gap do CHAR_TO_BYTE for other purposes
175 anyway, all of them should use move_gap_both instead.
176 * lisp.h (move_gap): Remove prototype.
177 * insdel.c (move_gap): Remove.
178 (move_gap_both): Add eassert.
179 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
180 * xml.c (parse_region): Likewise.
181
b8956427
PE
1822013-01-11 Paul Eggert <eggert@cs.ucla.edu>
183
184 emacsclient -t should not suspend Emacs server (Bug#13387)
185 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
186 New functions.
187 * term.c (init_tty): Use them instead of rolling our own code.
188 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
189 switches from 'signal' to 'pthread_sigmask', which is safer in
190 multithreaded applications.
191 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
192 which has already arranged for that.
193 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
194 This is the main part of the bug fix.
195
0b59090b 1962013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
48660ca5
JD
197
198 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
199 x_last_font_name (Bug#13403).
200
58cc0a01
DA
2012013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
202
203 Omit buffer_slot_type_mismatch and use generic predicates to enforce
204 the type of per-buffer values where appropriate.
205 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
206 predicate, which is how it's really used now. Adjust comment.
207 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
208 * buffer.c (buffer_slot_type_mismatch): Remove.
209 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
210 predicate. Adjust comment.
211 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
212 fill-column, left-margin, tab-width, buffer-saved-size,
213 left-margin-width, right-margin-width, left-fringe-width,
214 right-fringe-width, scroll-bar-width and buffer-display-count.
215 Use Qstringp for default-directory, buffer-file-name,
216 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
217 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
218 line-spacing.
219 * data.c (store_symval_forwarding): Adjust to call the predicate.
220
5104861e
JB
2212013-01-09 Juanma Barranquero <lekktu@gmail.com>
222
223 * w32.c (get_name_and_id, acl_set_file):
224 * w32term.c (w32fullscreen_hook): Remove unused local variables.
225
eefd7278
DA
2262013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
227
228 * lisp.h (make_gap_1): New prototype.
229 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
230 gap size values.
231 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
232 naming convention.
233 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
2eae9ccc 234 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
eefd7278
DA
235 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
236 (make_gap_1): New function to adjust the gap of any buffer.
237 * coding.c (coding_alloc_by_making_gap): Use it.
238 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
239 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
240
073ca75b
JL
2412013-01-08 Juri Linkov <juri@jurta.org>
242
243 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
244 of (supports :underline (:style wave)). (Bug#13000)
245
3bace969
AH
2462013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
247
248 * undo.c (Fprimitive_undo): Move to simple.el.
249 (syms_of_undo): Remove declarations for Sprimitive_undo.
250
63a63bd4
SM
2512013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
252
253 * keyboard.c (echo_add_key): Rename from echo_add_char.
254
56ed110a
CY
2552013-01-06 Chong Yidong <cyd@gnu.org>
256
257 * keyboard.c (echo_add_char): New function, factored out from
258 echo_char. Don't add a space if the previous echo string was
259 empty (Bug#13255).
260 (echo_char): Use it.
261 (read_key_sequence): When echoing mock input, ensure that the
262 trailing dash is properly added.
263
b630991b
EZ
2642013-01-05 Eli Zaretskii <eliz@gnu.org>
265
266 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
267 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
63a63bd4
SM
268 digits for buffer positions, before misalignment starts.
269 Display "0" for integer "object" field.
b630991b
EZ
270 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
271 Display the newline glyph more unambiguously.
272
f032a318
YM
2732013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
274
275 * nsterm.m (ns_draw_underwave):
276 * w32term.c (w32_draw_underwave):
277 * xterm.c (x_draw_underwave): Make underwave look more triangular
278 and also degrade gracefully for small fonts. (Bug#13000)
279
4240dd3c
YM
280 * nsterm.m (ns_draw_text_decoration):
281 * w32term.c (x_draw_glyph_string):
282 * xterm.c (x_draw_glyph_string): Don't use previous underline
283 thickness and position if previous underline type is underwave.
284
553081a5
SM
2852013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
286
287 * fileio.c (Ffile_acl): Undocument return format.
288
9539d465 2892013-01-02 Glenn Morris <rgm@gnu.org>
08f59219
GM
290
291 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
292
71376d4b
PE
2932013-01-02 Paul Eggert <eggert@cs.ucla.edu>
294
295 Simplify via eabs.
296 * dired.c (file_name_completion):
297 * doc.c (get_doc_string):
298 * floatfns.c (round2):
299 * font.c (font_score, font_delete_unmatched):
300 * fringe.c (compute_fringe_widths):
301 * lread.c (read_list):
302 * minibuf.c (Ftry_completion):
303 * term.c (tty_ins_del_lines):
304 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
305 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
306
a7f11948
EZ
3072012-12-31 Eli Zaretskii <eliz@gnu.org>
308
309 * w32.c (unsetenv): Set up the string passed to _putenv
63a63bd4
SM
310 correctly.
311 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
a7f11948
EZ
312 for the bug this caused.
313
84cc1ab6
PE
3142012-12-30 Paul Eggert <eggert@cs.ucla.edu>
315
316 * coding.c (Qmac): Now static.
317
5a1d858b
JD
3182012-12-30 Jan Djärv <jan.h.d@swipnet.se>
319
320 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
321 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
322 handlebox_widget. Set toolbar_in_hbox to false/true, set
323 toolbar_is_packed to true.
324 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
325 (update_frame_tool_bar): Check toolbar_is_packed for packing.
326 Show all on TOOLBAR_TOP_WIDGET.
327 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
328 by TOOLBAR_TOP_WIDGET.
329 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
330 Check toolbar_is_packed.
8b745d92
JD
331 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
332 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
333 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
334 false.
335 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
336 (xg_update_menubar): Update title only if
337 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
338 (xg_update_submenu): Skip tearoff only if
339 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
340 (xg_initialize): Initialize xg_detached_menus only if
341 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
5a1d858b
JD
342
343 * xterm.h (struct x_output): Surround handlebox_widget with
344 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
345 toolbar_in_hbox is bool.
346
d5e5e7b4 3472012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2550c6e4
AS
348
349 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
350 (LIBS_GNUSTEP): Define.
351 (LIBES): Add $(LIBS_GNUSTEP).
352 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
353
d5e5e7b4 3542012-12-30 Eli Zaretskii <eliz@gnu.org>
7a3a7493
EZ
355
356 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
357 continuation glyph on a TTY with an indication of an empty line.
358 (Bug#13277)
359
e7ae8039
EZ
3602012-12-29 Eli Zaretskii <eliz@gnu.org>
361
ccad023b
EZ
362 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
363 file's SELinux context or ACLs successfully set, nil otherwise.
364 (Bug#13298)
8d23a331 365 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
ccad023b 366
e7ae8039
EZ
367 * w32proc.c (reader_thread): Avoid passing NULL handles to
368 SetEvent and WaitForSingleObject.
369
7456e13f
PE
3702012-12-28 Paul Eggert <eggert@cs.ucla.edu>
371
372 Port EXTERNALLY_VISIBLE to Clang 3.2.
373 * conf_post.h (__has_attribute): New macro.
374 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
375
1ab0c851
GM
3762012-12-27 Glenn Morris <rgm@gnu.org>
377
378 * cygw32.c (Fcygwin_convert_file_name_to_windows)
379 (Fcygwin_convert_file_name_from_windows): Doc fixes.
380
82e2a1f0 3812012-12-27 Eli Zaretskii <eliz@gnu.org>
f5c81c80 382
63a63bd4
SM
383 * fileio.c (file_name_as_directory, directory_file_name):
384 Accept an additional argument MULTIBYTE to indicate whether the input C
f5c81c80
EZ
385 came from a multibyte or a unibyte Lisp string; all callers
386 adjusted. Don't assume the input string is always multibyte.
387 (Bug#13262)
388 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
389 don't ENCODE_FILE them, and return a unibyte string if the input
390 was unibyte.
391 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
392 don't assume the input strings will always be multibyte. If the
393 input strings are multibyte, decode strings obtained from C
394 library functions.
395
8847a0de
DA
3962012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
397
398 * lisp.h (toplevel): Add two notices to the comment about
399 defining a new Lisp data type.
6cda572a
DA
400 * print.c (print_object): If Lisp_Save_Value object's pointer
401 is the address of a memory area containing Lisp_Objects, try
402 to print them.
403 * alloc.c (valid_lisp_object_p): Adjust comment.
8847a0de 404
4b298d5a
DA
4052012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
406
407 * keyboard.c (record_asynch_buffer_change): Initialize an event
408 only if it's really needed.
409 * frame.h (enum output_method): Remove output_mac member since
410 it's a leftover from the deleted code.
411 * frame.c (Fframep): Adjust user here ...
412 * terminal.c (Fterminal_live_p): ... and here.
413 * coding.c (Qmac): Now here because it's only used to denote
414 end-of-line encoding type.
415 (syms_of_coding): DEFSYM it.
416 * frame.h (Qmac): Remove duplicated declaration.
417
12384b01
PE
4182012-12-26 Paul Eggert <eggert@cs.ucla.edu>
419
420 * window.c (select_window_1): Now static, since it's used only here.
421
f1665bdc
EZ
4222012-12-25 Eli Zaretskii <eliz@gnu.org>
423
424 * window.c (window_body_cols): Subtract display margins from the
425 window body width on TTYs as well. See
426 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
427 for the original report.
428
9a0d4f34
DA
4292012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
430
431 * xdisp.c (redisplay_window): Remove inner local variable
432 because the outer shadowed one has the same meaning.
cd78d9b1
DA
433 * xterm.h (struct x_output): Remove toolbar_detached member since it's
434 set but never used.
435 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
436 (xg_create_tool_bar): Adjust users.
9a0d4f34 437
f9e7c67e
DA
4382012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
439
440 * buffer.h (BUF_COMPACT): New macro to follow the common style.
441 * buffer.c (Fget_buffer_create): Use it to set compact field of
442 struct buffer_text to avoid accessing an uninitialized value
443 when compact_buffer is called for the first time.
444 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2944d406
DA
445 (Fset_buffer_modified_p): Use buffer_window_count to check
446 whether the buffer is displayed in some window.
447 * xdisp.c (message_dolog): Likewise.
f9e7c67e 448
299614f3
EZ
4492012-12-23 Eli Zaretskii <eliz@gnu.org>
450
40ff07a5
EZ
451 * w32.c (acl_set_file): If setting the file security descriptor
452 fails, and the new DACL is identical to the existing one, silently
453 return success. This fixes problems for users backing up their
454 own files without having the necessary privileges for setting
455 security descriptors.
456
299614f3
EZ
457 * w32proc.c (reader_thread): Do not index fd_info[] with negative
458 values.
459 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
460 after WaitForSingleObject returns normally. This expedites reader
461 thread shutdown when delete_child triggers it.
462 (reap_subprocess): More accurate commentary for why we call
463 delete_child only when cp->fd is negative.
464
465 * w32.c (sys_close): Do not call delete_child on a subprocess
466 whose handle is not yet closed. Instead, set its file descriptor
467 to a negative value, so that reap_subprocess will call
63a63bd4
SM
468 delete_child on that subprocess when its SIGCHLD arrives.
469 This avoids closing handles used for communications between sys_select
299614f3
EZ
470 and reader_thread, which doesn't give sys_select a chance to
471 notice that the process exited and invoke the SIGCHLD handler for
472 it.
473
cf162aee
JD
4742012-12-23 Jan Djärv <jan.h.d@swipnet.se>
475
476 * nsfns.m (Fns_do_applescript): Run event loop until script has
477 been executed (Bug#12969).
478 (ns_run_ascript): Chech as_script for nil, set to nil after
479 executing script.
480
94900bfe
MR
4812012-12-22 Martin Rudalics <rudalics@gmx.at>
482
483 * window.c (Fselect_window): Reword doc-string (Bug#13248).
484
b2faf49c
EZ
4852012-12-22 Eli Zaretskii <eliz@gnu.org>
486
487 * w32term.c (w32fullscreen_hook): New function.
488 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
489
7efa3fb3
EZ
4902012-12-21 Eli Zaretskii <eliz@gnu.org>
491
bb085aed
EZ
492 * fileio.c (Finsert_file_contents): Doc fix.
493
7efa3fb3
EZ
494 * w32proc.c (new_child, delete_child, find_child_pid): For a
495 subprocess, consider its slot being in use as long as its process
496 handle (procinfo.hProcess) is not NULL. This avoids reusing the
497 slot when a new process is started immediately after killing
498 another one, without waiting enough time for the first process to
499 be reaped and resources allocated for it be orderly freed.
500 (Bug#13086)
501 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
502
c1f02afa
CY
5032012-12-21 Chong Yidong <cyd@gnu.org>
504
505 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
506
5bec25eb
CY
507 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
508
a4b0cca1 5092012-12-21 Eli Zaretskii <eliz@gnu.org>
92340ec7
EZ
510
511 * w32.c (get_name_and_id): Always pass NULL as the first argument
512 of lookup_account_sid. Avoids crashes with UNC file names that
513 refer to DFS domains, not to specific machine names. (Bug#12621)
514 Remove now unused argument FNAME; all callers changed.
515 (get_file_owner_and_group): Remove now unused argument FNAME; all
516 callers changed.
517
34b4b7eb
CY
5182012-12-21 Chong Yidong <cyd@gnu.org>
519
520 * editfns.c (Finsert_char): Since read-char-by-name now signals an
521 error for invalid chars, don't check for a nil return value.
522
13002885
DA
5232012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
524
525 Avoid calls to CHAR_TO_BYTE if byte position is known.
526 * editfns.c (make_buffer_string_both): Use move_gap_both.
527 (Fbuffer_string): Use make_buffer_string_both.
528 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
529 Adjust comment.
530 (buf_bytepos_to_charpos): Likewise.
531 (charpos_to_bytepos): Remove.
532 * fileio.c (Finsert_file_contents): Use move_gap_both.
533 * search.c (Freplace_match): Likewise.
9a0d4f34 534 * process.c (process_send_region): Likewise. Use convenient
13002885
DA
535 names for byte positions.
536 * lisp.h (charpos_to_bytepos): Remove prototype.
537 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
538 * insdel.c (move_gap): Likewise.
539
99e9311c
PE
5402012-12-20 Paul Eggert <eggert@cs.ucla.edu>
541
542 * xdisp.c (redisplay_internal): Remove now-unused local.
543
e02230bf
SM
5442012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
545
546 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
547 (redisplay_internal): Don't bother selecting the frame to get the
4a74c818 548 proper value of frame-local variables (bug#13225).
e02230bf 549
1687fb14
DA
5502012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
551
552 * textprop.c (set_text_properties_1): Do not allow NULL interval.
553 Rename 4th argument since it may be buffer or string. Adjust comment.
554 * intervals.c (graft_intervals_info_buffer): Find an interval here.
555
a2f07cd2
DA
5562012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
557
558 * coding.c (Fdetect_coding_region): Do not check start and end with
559 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
560 (code_convert_region): Likewise.
561
474d441e
EZ
5622012-12-18 Eli Zaretskii <eliz@gnu.org>
563
564 * w32.c (acl_get_file, acl_set_file): Run the file name through
565 map_w32_filename, and resolve any symlinks in the file name, like
566 Posix platforms do.
567 (acl_set_file): Call revert_to_self, if any privileges were
568 enabled.
569
8725c076
JB
5702012-12-17 Juanma Barranquero <lekktu@gmail.com>
571
572 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
573 ($(BLD)/w32.$(O)): Update dependencies.
574
1e101a4b
SM
5752012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
576
577 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
578 propagate redisplay's scrolling (if any) to the right window.
579 (redisplay_internal): Use ensure_selected_frame.
580 (display_mode_lines): Complete last fix.
581 * window.c (select_window_1): New func, extracted from select_window.
582 (select_window): Use it.
583 * window.h (select_window_1): Declare.
584
66447e07
EZ
5852012-12-17 Eli Zaretskii <eliz@gnu.org>
586
587 Emulate Posix ACL APIs on MS-Windows.
588 * w32.c: Include sddl.h and sys/acl.h.
589 (SDDL_REVISION_1): Define if not already defined.
590 (g_b_init_get_security_descriptor_dacl)
591 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
592 (g_b_init_is_valid_security_descriptor)
593 (g_b_init_set_file_security): New static flags.
594 (globals_of_w32): Initialize them to zero.
595 (SetFileSecurity_Name): New string constant.
596 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
597 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
598 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
599 (IsValidSecurityDescriptor_Proc): New typedefs.
600 (get_file_security, get_security_descriptor_owner)
601 (get_security_descriptor_group): Set errno to ENOTSUP.
602 (set_file_security, get_security_descriptor_dacl)
603 (is_valid_security_descriptor, convert_sd_to_sddl)
604 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
605 (acl_free, acl_get_file, acl_set_file): New functions.
606
607 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
608
207a7ef0
PE
6092012-12-17 Paul Eggert <eggert@cs.ucla.edu>
610
611 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
612 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
613 for some of that bug's symptoms can now cause Emacs to abort.
614 Remove the workaround.
615 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
616 The bug that caused SIGCHLD to get lost has been fixed, and the
617 workaround for it can now cause Emacs to abort.
618
17fdfc15
PE
6192012-12-16 Paul Eggert <eggert@cs.ucla.edu>
620
621 * sysdep.c (emacs_abort): Bump backtrace size to 40.
622 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
623 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
624
7c3d167f
RF
6252012-12-16 Romain Francoise <romain@orebokech.com>
626
627 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
628 (Fcopy_file): Change last arg to `preserve_extended_attributes'
1e101a4b 629 and copy ACL entries of file in addition to SELinux context if set.
7c3d167f
RF
630 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
631
632 * Makefile.in (LIBACL_LIBS): New macro.
633 (LIBES): Use it.
634
7d80ea23
PE
6352012-12-15 Paul Eggert <eggert@cs.ucla.edu>
636
637 * fileio.c (internal_delete_file): Use bool for boolean.
638
b0728617
EZ
6392012-12-15 Eli Zaretskii <eliz@gnu.org>
640
641 Fix bug #13079 on MS-Windows with temp files not being deleted.
642 * w32.h (_child_process): New members input_file and
643 pending_deletion.
644 (register_child): First argument is now pid_t.
645 (record_infile, record_pending_deletion): New prototypes.
646
647 * w32proc.c (new_child): Initialize input_file and
648 pending_deletion members of the child.
649 (delete_child): Delete the child's temporary input file, if any,
650 that is pending deletion.
651 (register_child): First argument is now pid_t.
652 (record_infile, record_pending_deletion): New functions.
653 (reap_subprocess): Fix a typo in DebPrint string.
654 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
655
656 * fileio.c (internal_delete_file): Return an int again: non-zero
657 if delete-file succeeds, zero otherwise.
658
659 * lisp.h (internal_delete_file): Adjust prototype.
660
661 * callproc.c (Fcall_process): Don't overwrite infile with result
662 of DECODE_FILE.
663 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
664 asynchronous subprocess, record the name of the input file name,
665 if any.
666 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
667 delete the file, record it as pending deletion when the subprocess
668 exits.
669
7e90af26
EZ
6702012-12-14 Eli Zaretskii <eliz@gnu.org>
671
672 * editfns.c [HAVE_PWD_H]: Include grp.h.
673
674 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
675
97976f9f
PE
6762012-12-14 Paul Eggert <eggert@cs.ucla.edu>
677
678 Fix permissions bugs with setgid directories etc. (Bug#13125)
679 * dired.c (Ffile_attributes): Return t as the 9th attribute,
680 to mark it as a placeholder. The old value was often wrong.
681 The only user of this attribute has been changed to use
682 file-ownership-preserved-p instead, with its new group arg.
683 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
684
26ec1f49
SM
6852012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
686
ad966fe7
SM
687 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
688 Keep selected_window and selected_frame in sync.
26ec1f49 689
5c207910
EZ
6902012-12-14 Eli Zaretskii <eliz@gnu.org>
691
692 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
693 try to get accurate owner and group information from NT file
694 security APIs. This is to make most callers of 'stat' and
695 'lstat', which don't need that information, much faster.
696
26ec1f49
SM
697 * dired.c (Ffile_attributes) [WINDOWSNT]:
698 Set w32_stat_get_owner_group to a non-zero value, to request accurate
5c207910
EZ
699 owner and group information from 'lstat'.
700
893f52d8
PE
7012012-12-13 Paul Eggert <eggert@cs.ucla.edu>
702
4c95c9a5
PE
703 * fileio.c (Finsert_file_contents): Don't put tail into head area,
704 as that confuses set-auto-coding, so insist on the head-read
705 returning the full 1024 bytes. Let lseek compute the tail offset;
706 less work for us. Do not ignore I/O errors when reading the tail.
707
893f52d8
PE
708 * xdisp.c: Minor style fixes.
709 (init_iterator): Hoist assignment out of if-expression.
710 (markpos_of_region): Callers now test for sign, not for -1.
711
40d1e434
DA
7122012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
713
714 Minor redisplay optimization when the region length is zero.
715 * xdisp.c (markpos_of_region): New function.
716 (init_iterator): Do not highlight the region of zero length.
717 (redisplay_window): Check whether the region is of non-zero length.
718 (try_cursor_movement): Allow if the region length is zero.
719 (try_window_reusing_current_matrix, try_window_id): Likewise.
720
727f9739 7212012-12-13 Eli Zaretskii <eliz@gnu.org>
e8c6e965
EZ
722
723 * search.c (search_buffer): Check the inverse translations of each
724 character in pattern when the buffer being searched is unibyte.
725 (Bug#13084)
726
727f9739 7272012-12-13 Paul Eggert <eggert@cs.ucla.edu>
184246df
PE
728
729 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
730 files, fixing a regression from 24.2.
645c6a30 731 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
184246df 732
d20704ef
PE
7332012-12-13 Paul Eggert <eggert@cs.ucla.edu>
734
735 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
736 fstat shouldn't fail, and if it does fail copy-file should not proceed.
737 Remove unnecessary S_ISLNK test, as (contra the comments) this
738 function can't copy symlinks. Improve quality of error message
739 when attempting to copy files that are neither regular files nor
740 directories.
741
2dd61a9b
DA
7422012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
743
744 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
745 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
746 * window.c (Frecenter):
747 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
748 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
749
cc98b684
DC
7502012-12-12 Daniel Colascione <dancol@dancol.org>
751
1e101a4b 752 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
cc98b684
DC
753 the dumped Emacs is not a sparse file, greatly improving Cygwin
754 "make bootstrap" performance.
755
38e791fd
MA
7562012-12-11 Michael Albinus <michael.albinus@gmx.de>
757
758 * inotify.c (inotify_callback): Generate an Emacs event for every
759 incoming inotify event.
760
f9d1448f
EZ
7612012-12-11 Eli Zaretskii <eliz@gnu.org>
762
763 * xdisp.c (handle_face_prop): Fix logic of computing
764 it->start_of_box_run_p.
765 (append_space_for_newline): If the glyph row is R2L, reset the
766 iterator's end_of_box_run_p flag before prepending the space glyph.
767 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
768 iterator's start_of_box_run_p flag before prepending the stretch.
769 (append_glyph, produce_image_glyph, append_composite_glyph)
770 (append_stretch_glyph, append_glyphless_glyph): Reverse the
771 left_box_line_p and right_box_line_p flags of the glyph for R2L
772 glyph rows. (Bug#13011)
773
c6afe371
DA
7742012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
775
776 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
777 if changed buffer is not shown in a window.
778 * insdel.c (prepare_to_modify_buffer): Likewise.
779 * window.c (replace_buffer_in_windows_safely): Do nothing
780 if buffer is not shown in a window.
781 (Fforce_window_update): Likewise if string or buffer argument
782 is passed.
783
1b47babd
EZ
7842012-12-11 Eli Zaretskii <eliz@gnu.org>
785
786 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
787 encoded_file_name, which is what it is.
788
4c1acb95
DA
7892012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
790
791 Consistently use marker_position and marker_byte_position.
792 * fringe.c (Ffringe_bitmaps_at_pos):
793 * indent.c (Fvertical_motion):
794 * insdel.c (prepare_to_modify_buffer):
795 * keyboard.c (make_lispy_position):
796 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
797 (window_scroll_pixel_based, displayed_window_lines)
798 (Fset_window_configuration):
799 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
800 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
801 Replace direct access to marker fields with calls
802 to marker_position and/or marker_byte_position.
803
0eeb69fe
JB
8042012-12-11 Juanma Barranquero <lekktu@gmail.com>
805
806 * makefile.w32-in (SIG2STR_H): New macro.
807 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
808 ($(BLD)/w32notify.$(O)): Update dependencies.
809
1cf1bbd5
DC
8102012-12-10 Daniel Colascione <dancol@dancol.org>
811
8db4b52f
DC
812 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
813 Windows file notification functionality unless WINDOWSNT.
814
1cf1bbd5
DC
815 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
816 declarations.
817
818 * w32fns.c (cache_system_info): Initialize the global hinst
819 variable here so various initialization calls DTRT.
820
1e101a4b 821 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
1cf1bbd5
DC
822 (hinst): Remove unneeded extern declaration.
823 (_start): Remove initialization of above variables; remove
824 initialization of hinst, as cache_system_info now does that.
825
826 * emacs.c (main): Call cache_system_info early in startup; we
827 previously weren't calling it in Cygwin builds.
828
26ec1f49
SM
829 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
830 Teach the autoconf build system how to compile a Windows resource file
1cf1bbd5
DC
831 and link it to Emacs.
832
98a07056
DA
8332012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
834
835 Per-buffer window counters.
836 * buffer.h (struct buffer): New member window_count.
837 (buffer_window_count): New function.
838 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
839 Initialize window_count.
840 (Fkill_buffer): Verify window_count for the buffer being killed.
841 (modify_overlay): Do not force redisplay if buffer is not shown
842 in any window.
843 (init_buffer_once): Initialize window_count for buffer_defaults
844 and buffer_local_symbols.
845 * window.h (buffer_shared): Remove declaration.
846 (wset_buffer): Convert from inline ...
847 * window.c (wset_buffer): ... to an ordinary function.
848 (adjust_window_count): New function.
849 (make_parent_window): Use it.
850 * xdisp.c (buffer_shared): Remove.
851 (redisplay_internal, redisplay_window): Adjust users.
852 (buffer_shared_and_changed): Use per-buffer window counter.
853
2b8c9064
EZ
8542012-12-10 Eli Zaretskii <eliz@gnu.org>
855
856 Support for filesystem notifications on MS-Windows.
857 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
858 and this is a TTY frame, signal the caller that keyboard input is
859 available.
860
861 * w32xfns.c (drain_message_queue): Now returns an int: an
862 indication whether any WM_EMACS_FILENOTIFY messages were found in
863 the queue.
864
865 * w32inevt.c (handle_file_notifications): New function.
866 (w32_console_read_socket): Call it to process file notifications.
867
868 * w32console.c (initialize_w32_display): Record the main thread ID
869 in dwMainThreadId.
870
871 * deps.mk (inotify.o): New dependency list.
872
873 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
874
875 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
876 (WM_EMACS_END): Bump value by 1.
877 (notification_buffer_in_use, file_notifications)
878 (notifications_size, notifications_desc): Declare.
879 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
880 Add prototypes.
881
882 * w32term.c (lispy_file_action, queue_notifications): New functions.
883 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
884 <Qrenamed_to>: New symbols.
885 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
886
887 * w32notify.c: New file, implements file event notifications for
888 MS-Windows.
889
890 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
891 by posting it to the w32_read_socket queue.
892
1e101a4b 893 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2b8c9064
EZ
894
895 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
896 (GLOBAL_SOURCES): Add w32notify.c
897 ($(BLD)/w32notify.$(O)): New set of dependencies.
898
899 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
900
1e101a4b
SM
901 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
902 Handle FILE_NOTIFY_EVENT.
2b8c9064
EZ
903 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
904 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
905 w32notify-handle-event by default.
906
907 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
908 syms_of_w32notify.
909
81606b10
RS
9102012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
911
2b8c9064 912 Support for filesystem notifications on GNU/Linux via inotify.
1e101a4b 913 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
81606b10
RS
914
915 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
916
917 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
918 (syms_of_keyboard): DEFSYM it.
919 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
920 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
921 Qfile_inotify events.
922 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
923 special-event-map to inotify-handle-event.
924
925 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
926
927 * Makefile.in (base_obj): Add inotify.o.
928
929 * inotify.c: New file.
930
265c2fbf 9312012-12-10 Jan Djärv <jan.h.d@swipnet.se>
a06ae17d
JD
932
933 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
934
265c2fbf 9352012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
cb576b5c
FP
936
937 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
938 DWORD_PTR, for compatibility with 64-bit builds.
939
a06ae17d 940 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
cb576b5c
FP
941 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
942 (system_process_attributes): Use SIZE_T rather than DWORD, for
943 compatibility with 64-bit builds.
944
265c2fbf 9452012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
76b92fee
CS
946
947 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
948
265c2fbf 9492012-12-10 Eli Zaretskii <eliz@gnu.org>
81d8cc53
EZ
950
951 * indent.c (Fvertical_motion): If a display string will be
952 displayed on the left or the right margin, don't consider it as a
953 factor in cursor positioning. (Bug#13108)
954
265c2fbf 9552012-12-10 Martin Rudalics <rudalics@gmx.at>
2cec368c
MR
956
957 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
958
5f460827
PE
9592012-12-10 Paul Eggert <eggert@cs.ucla.edu>
960
961 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
962 for string length.
963
a16e75cd
EZ
9642012-12-08 Eli Zaretskii <eliz@gnu.org>
965
966 * w32.c (unsetenv): Return 0 if the input string is too long.
967
5745a7df
PE
9682012-12-08 Paul Eggert <eggert@cs.ucla.edu>
969
970 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
971 * alloc.c (xputenv): New function.
972 * dbusbind.c (Fdbus_init_bus):
973 * emacs.c (main):
974 * xterm.c (x_term_init):
975 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
976 * editfns.c (initial_tz): Move static var decl up.
977 (tzvalbuf_in_environ): New static var.
978 (init_editfns): Initialize these two static vars.
979 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
980 Save old TZ value on stack, if it's small.
981 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
982 instead, use xputenv+unsetenv to set and restore TZ.
983 (environbuf): Remove static var. All uses removed.
984 (Fset_time_zone_rule): Do not save TZ and environ;
985 no longer needed here.
986 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
987 Move to inside set_time_zone_rule; they don't need file scope any more.
988 (set_time_zone_rule): Maintain the TZ=value string separately.
989 (syms_of_editfns): Don't initialize initial_tz;
990 init_editfns now does it.
991 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
992 * lisp.h (xputenv): New decl.
993
c56efa40
FP
9942012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
995
996 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
997
75ceee05
EZ
9982012-12-08 Eli Zaretskii <eliz@gnu.org>
999
1000 * w32.c (unsetenv, sys_putenv): New functions.
1001
1b6dbfeb
CY
10022012-12-08 Chong Yidong <cyd@gnu.org>
1003
1004 * editfns.c (Finsert_char): Make the error message more
1005 informative (Bug#12992).
1006
d983a10b
PE
10072012-12-08 Paul Eggert <eggert@cs.ucla.edu>
1008
7be78020
PE
1009 Simplify get_lim_data.
1010 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
1011 Remove USG and vlimit methods; no longer used these days.
1012 Add #error catchall just in case.
1013
d983a10b
PE
1014 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
1015 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
1016 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
1017 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
1018 (deleted_pid_list, Fdelete_process, create_process)
1019 (record_child_status_change, handle_child_signal, deliver_child_signal)
1020 (init_process_emacs, syms_of_process):
1021 Assume SIGCHLD is defined.
1022 (parse_signal): Remove. All uses removed.
1023 (abbr_to_signal): New static function.
1024 (Fsignal_process): Use it to convert signal names to ints.
1025 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
1026 kill (getpgrp (), ...).
1027 (emacs_sigaction_init): Assume SIGCHLD is defined.
1028 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
1029 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
1030 * syssignal.h (EMACS_KILLPG): Remove.
1031 All uses replaced by 'kill' with a negative pid.
1032 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
1033 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
1034
9cdde1e2
PE
10352012-12-07 Paul Eggert <eggert@cs.ucla.edu>
1036
1037 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
1038 This will cause a production Emacs to dump core instead of
1039 infinite-looping.
1040
822995f8
DA
10412012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
1042
1043 * frame.c (make_frame): Do not set window's buffer to t.
1044 * window.c (Fsplit_window_internal): Likewise. Previously it was
1045 used to indicate that the window is being set up. Now we use
1046 set_window_buffer for all new windows, so the condition in ...
1047 (Fset_window_buffer): ... is always true and can be removed.
1048
ed08365b
DA
10492012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
1050
1051 Convenient macro to check whether the buffer is hidden.
1052 * buffer.h (BUFFER_HIDDEN_P): New macro.
1053 * frame.c (make_frame): Use it. Adjust comment.
1054 * buffer.c (candidate_buffer): New function.
1055 (Fother_buffer, other_buffer_safely): Use it.
1056
e86f5134
EZ
10572012-12-06 Eli Zaretskii <eliz@gnu.org>
1058
1059 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
1060 if the child process is still running. Instead, exit the wait
1061 loop and return zero. (Bug#13086)
1062
1700db3c
DA
10632012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
1064
1065 * frame.h (x_char_width, x_char_height): Remove prototypes.
1066 * w32term.h (x_char_width, x_char_height): Likewise.
1067 * xfns.c (x_char_width, x_char_height): Remove.
1068 * w32fns.c (x_char_width, x_char_height): Likewise.
1069 * nsfns.c (x_char_width, x_char_height): Likewise.
1070 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
1071 all window frames.
1072 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
1073 * keyboard.c (command_loop_1): Remove prototype.
1074 (command_loop_2, top_level_1): Add static to match prototype.
1075
35fb8050
PE
10762012-12-06 Paul Eggert <eggert@cs.ucla.edu>
1077
1078 Fix a recently-introduced delete-process race condition.
1079 * callproc.c, process.h (record_kill_process):
1080 New function, containing part of the old call_process_kill.
1081 (call_process_kill): Use it.
1082 This does not change call_process_kill's behavior.
1083 * process.c (Fdelete_process): Use record_kill_process to fix a
1084 race condition that could cause Emacs to lose track of a child.
1085
565212e5
DA
10862012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
1087
1088 Avoid code duplication between prev_frame and next_frame.
1089 * frame.c (candidate_frame): New function. Add comment.
1090 (prev_frame, next_frame): Use it. Adjust comment.
1091
d8ad4d3f 10922012-12-06 Eli Zaretskii <eliz@gnu.org>
d3cefd13
EZ
1093
1094 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
1095 fails, signal an error instead of continuing with an empty
1096 string. (Bug#13079)
7c2fcf9b
EZ
1097 Encode expanded temp file pattern before passing it to mkstemp or
1098 mktemp.
d3cefd13 1099
2e7cddd3
EZ
1100 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
1101 Encode the file name before passing it to dostounix_filename, in
1102 case it will downcase it (under w32-downcase-file-names).
1103 (Bug#12933)
1104
644d3f0d
PE
11052012-12-05 Paul Eggert <eggert@cs.ucla.edu>
1106
1107 Minor call-process cleanups.
1108 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
1109 at the same time as other platforms, to simplify analysis.
1110 No need for fd0_volatile since we have synch_process_fd.
1111 Avoid needless emacs_close; arg is always negative.
1112
396376f1
AS
11132012-12-04 Andreas Schwab <schwab@linux-m68k.org>
1114
1115 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
1116 processes.
1117
350f51ad
DA
11182012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
1119
1120 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
1121 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
1122 and mouse_face_hidden members to a bitfields.
1123 * frame.h (struct frame): Remove set-but-not-used space_width member.
1124 (FRAME_SPACE_WIDTH): Remove.
1125 * nsterm.m, w32term.c, xterm.c: Adjust users.
1126 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
1127 member. Adjust users. Convert term_initted, delete_in_insert_mode,
1128 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
1129 members to a bitfields.
1130
bc9dbce6
PE
11312012-12-03 Paul Eggert <eggert@cs.ucla.edu>
1132
bb5f74ee
PE
1133 Don't let call-process be a zombie factory (Bug#12980).
1134 Fixing this bug required some cleanup of the signal-handling code.
1135 As a side effect, this change also fixes a longstanding rare race
1136 condition whereby Emacs could mistakenly kill unrelated processes,
1137 and it fixes a bug where a second C-g does not kill a recalcitrant
1138 synchronous process in GNU/Linux and similar platforms.
1139 The patch should also fix the last vestiges of Bug#9488,
1140 a bug which has mostly been fixed on the trunk by other changes.
1141 * callproc.c, process.h (synch_process_alive, synch_process_death)
1142 (synch_process_termsig, sync_process_retcode):
1143 Remove. All uses removed, to simplify analysis and so that
1144 less consing is done inside critical sections.
1145 * callproc.c (call_process_exited): Remove. All uses replaced
1146 with !synch_process_pid.
1147 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
1148 These take the role of what used to be in unwind-protect arg.
1149 All uses changed.
1150 (block_child_signal, unblock_child_signal):
1151 New functions, to avoid races that could kill innocent-victim processes.
1152 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
1153 (call_process_kill): Record killed processes as deleted, so that
1154 zombies do not clutter up the system. Do this inside a critical
1155 section, to avoid a race that would allow the clutter.
1156 (call_process_cleanup): Fix code so that the second C-g works again
1157 on common platforms such as GNU/Linux.
1158 (Fcall_process): Create the child process in a critical section,
1159 to fix a race condition. If creating an asynchronous process,
1160 record it as deleted so that zombies do not clutter up the system.
1161 Do unwind-protect for WINDOWSNT too, as that's simpler in the
1162 light of these changes. Omit unnecessary call to emacs_close
1163 before failure, as the unwind-protect code does that.
1164 * callproc.c (call_process_cleanup):
1165 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
1166 * process.c (record_deleted_pid): New function, containing
1167 code refactored out of Fdelete_process.
1168 (Fdelete_process): Use it.
1169 (process_status_retrieved): Remove. All callers changed to use
1170 child_status_change.
1171 (record_child_status_change): Remove, folding its contents into ...
1172 (handle_child_signal): ... this signal handler. Now, this
1173 function is purely a handler for SIGCHLD, and is not called after
1174 a synchronous waitpid returns; the synchronous code is moved to
1175 wait_for_termination. There is no need to worry about reaping
1176 more than one child now.
1177 * sysdep.c (get_child_status, child_status_changed): New functions.
1178 (wait_for_termination): Now takes int * status and bool
1179 interruptible arguments, too. Do not record child status change;
1180 that's now the caller's responsibility. All callers changed.
1181 Reimplement in terms of get_child_status.
1182 (wait_for_termination_1, interruptible_wait_for_termination):
1183 Remove. All callers changed to use wait_for_termination.
1184 * syswait.h: Include <stdbool.h>, for bool.
1185 (record_child_status_change, interruptible_wait_for_termination):
1186 Remove decls.
1187 (record_deleted_pid, child_status_changed): New decls.
1188 (wait_for_termination): Adjust to API changes noted above.
1189
bc9dbce6
PE
1190 * bytecode.c, lisp.h (Qbytecode): Remove.
1191 No longer needed after 2012-11-20 interactive-p changes.
1192
3cf3c607
EZ
11932012-12-03 Eli Zaretskii <eliz@gnu.org>
1194
1195 * xdisp.c (redisplay_window): If the cursor is visible, but inside
1196 the scroll margin, move point outside the margin. (Bug#13055)
1197
005c8d13
JD
11982012-12-03 Jan Djärv <jan.h.d@swipnet.se>
1199
1200 * gtkutil.c (my_log_handler): New function.
1201 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
1202
20edc1c9
DA
12032012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
1204
1205 * lisp.h (modify_region): Rename to...
1206 (modify_region_1): ...new prototype.
1207 * textprop.c (modify_region): Now static. Adjust users.
1208 * insdel.c (modify_region): Rename to...
1209 (modify_region_1): ...new function to work with current buffer.
1210 Adjust comment and users. Use true and false for booleans.
1211
62c2e5ed
DA
12122012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
1213
1214 * alloc.c (free_save_value): New function.
1215 (safe_alloca_unwind): Use it.
1216 * lisp.h (free_save_value): New prototype.
1217 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
1218 Add comment.
1219 (save_excursion_restore): Adjust to match saved data structure.
1220 Use free_save_value to offload some work from GC. Drop obsolete
1221 #if 0 code.
1222
c5bc2d1d 12232012-12-03 Chong Yidong <cyd@gnu.org>
a2458031
CY
1224
1225 * fileio.c (Vauto_save_list_file_name): Doc fix.
1226
c5bc2d1d 12272012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
c7b36b95
FP
1228
1229 * w32fns.c: Remove prototype of atof.
1e101a4b 1230 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
c7b36b95 1231 builds.
1e101a4b 1232 (file_dialog_callback): Make it UINT_PTR.
c7b36b95
FP
1233
1234 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
1235 with 64-bit builds.
1236
1237 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
1238 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
1239 defined.
1240
c5bc2d1d 12412012-12-03 Glenn Morris <rgm@gnu.org>
14d27346 1242
a9de9f0c 1243 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
14d27346 1244
21e54a94
PE
12452012-12-02 Paul Eggert <eggert@cs.ucla.edu>
1246
2dd2e622
PE
1247 Fix xpalloc confusion after memory is exhausted.
1248 * alloc.c (xpalloc): Comment fix.
1249 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
1250 and signals an error, do not clear charset_table_size, as
1251 charset_table is still valid.
1252 * doprnt.c (evxprintf): Clear *BUF after freeing it.
1253
21e54a94
PE
1254 Use execve to avoid need to munge environ (Bug#13054).
1255 * callproc.c (Fcall_process):
1256 * process.c (create_process):
1257 Don't save and restore environ; no longer needed.
1258 * callproc.c (child_setup):
1259 Use execve, not execvp, to preserve environ.
1260
3e5490f7
PE
12612012-12-01 Paul Eggert <eggert@cs.ucla.edu>
1262
1263 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
1264
75b4f59c
YM
12652012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1266
1267 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
1268 display for sliced images (Bug#10500).
1269
1270 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
1271
f8aff4c6
JB
12722012-11-30 Juanma Barranquero <lekktu@gmail.com>
1273
1274 * doc.c (Fdocumentation): Re-add handling of function-documentation,
1275 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
1276
3940b924
DA
12772012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
1278
1279 * xdisp.c (window_outdated): Remove eassert since it hits
1280 some suspicious corner cases (see Bug#13007 and Bug#13012).
1281 (mode_line_update_needed): New function.
1282 (redisplay_internal, redisplay_window): Use it.
1283 (ensure_selected_frame): New function.
1284 (redisplay_internal, unwind_redisplay): Use it.
1285 (redisplay_internal): Move comment about buffer_shared...
1286 (buffer_shared_and_changed): ...near to its real use.
1287
4a9204fe
PE
12882012-11-29 Paul Eggert <eggert@cs.ucla.edu>
1289
1290 * callproc.c (Fcall_process): Don't misreport vfork failure.
1291
60aeceb8
PE
12922012-11-28 Paul Eggert <eggert@cs.ucla.edu>
1293
1294 * callproc.c (Fcall_process): Fix vfork portability problems.
1295 Do not assume that fd[0], count, filefd, and save_environ survive
1296 vfork. Fix bug whereby wrong errno value could be reported for
1297 pipe failure. Some minor cleanups, too, as follows. Move buf and
1298 bufsize to the context where they're needed. Change new_argv to
1299 be of type char **, as this is more convenient and avoids casts.
1300 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
1301 Now local constants, not macros.
1302
00dc3ead
KH
13032012-11-18 Kenichi Handa <handa@gnu.org>
1304
1305 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
1306 for the variable "f".
1307
e1bf05c1
KH
13082012-11-13 Kenichi Handa <handa@gnu.org>
1309
1310 * font.c (font_unparse_xlfd): Exclude special characters from the
1311 generating XLFD name.
1312
22626a85
PE
13132012-11-27 Paul Eggert <eggert@cs.ucla.edu>
1314
350e0088
PE
1315 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
1316 * dired.c (stat_uname, stat_gname):
1317 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
1318
22626a85
PE
1319 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
1320 * dired.c (directory_files_internal, file_name_completion):
1321 Assume EAGAIN and EINTR are defined.
350e0088 1322
22626a85
PE
1323 * fileio.c (Fcopy_file): Assume EISDIR is defined.
1324 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
1325 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
1326 * lread.c (readbyte_from_file): Assume EINTR is defined.
1327 * process.c (wait_reading_process_output, send_process) [subprocesses]:
1328 Assume EIO and EAGAIN are defined.
1329 * unexcoff.c (write_segment): Assume EFAULT is defined.
1330
5c9cf0a3 13312012-11-27 Eli Zaretskii <eliz@gnu.org>
3fa1e84d
EZ
1332
1333 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
1334 (Bug#11964)
1335
22294a56
EZ
1336 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
1337 highlighting on the frame was cleared. Prevents assertion
1338 violations when repeatedly clicking on the "Top" link of the
1339 "bread-crumbs" in Info buffers.
1340
5fbab051
PE
13412012-11-25 Paul Eggert <eggert@cs.ucla.edu>
1342
1343 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
1344
bcd77a2b
KB
13452012-11-24 Ken Brown <kbrown@cornell.edu>
1346
1347 * keyboard.c (HAVE_MOUSE):
1348 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
1349 were always defined.
1350
d125ca15 13512012-11-24 Eli Zaretskii <eliz@gnu.org>
8654a41b 1352
24becea4
EZ
1353 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
1354 between bpos_covered and bpos_max. This fixes cursor display when
1355 several display strings follow each other.
1356
8654a41b
EZ
1357 * .gdbinit (pgx): If the glyph's object is a string, display the
1358 pointer to string data, rather than the value of the string object
1359 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
1360
cb5867b1
EZ
1361 * indent.c (Fvertical_motion): If the starting position is covered
1362 by a display string, return to one position before that, to avoid
1363 overshooting it inside move_it_to. (Bug#12930)
1364
f418b22e
DA
13652012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
1366
1367 * frame.h (struct frame): Remove display_preempted member
1368 since all users are dead long ago.
1369 * nsterm.h (struct x_output): Use the only dummy member.
1370 * w32menu.c (pending_menu_activation): Remove since not
1371 really used.
1372 (set_frame_menubar): Adjust user.
1373 * w32term.h (struct x_output): Drop outdated #if 0 code.
1374 (struct w32_output): Use bitfields for explicit_parent,
26ec1f49
SM
1375 asked_for_visible and menubar_active members.
1376 Drop unused pending_menu_activation member.
f418b22e
DA
1377 * xterm.h (struct x_output): Drop outdated #if 0 code.
1378 Use bitfields for explicit_parent, asked_for_visible,
1379 has_been_visible and net_wm_state_hidden_seen members.
1380
a879f0ea
EZ
13812012-11-23 Eli Zaretskii <eliz@gnu.org>
1382
1383 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
1384 of a literal "/". (Bug#12955)
1385 (gl-stamp): Invoke fc.exe directly, not through cmd.
1386
95ef7787
PE
13872012-11-23 Paul Eggert <eggert@cs.ucla.edu>
1388
1389 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
1390 * dired.c: Assume HAVE_DIRENT_H.
1391 (NAMLEN): Remove, replacing with ...
1392 (dirent_namelen): New function. All uses changed. Use the GNU macro
1393 _D_EXACT_NAMELEN if available, as it's faster than strlen.
1394 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
1395 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
1396 * makefile.w32-in (DIR_H): Remove. All uses replaced with
1397 $(NT_INC)/dirent.h.
1398 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
1399 * ndir.h: Rename to ../nt/inc/dirent.h.
1400 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
1401 Do not include <dirent.h>; no longer needed.
1402 * w32.c: Include <dirent.h> rather than "ndir.h".
1403
12645ae6
CY
14042012-11-23 Chong Yidong <cyd@gnu.org>
1405
1406 * xftfont.c (xftfont_open): Remove duplicate assignment.
1407
5c747675
DA
14082012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
1409
1410 * alloc.c (Fgarbage_collect): Unblock input after clearing
1411 gc_in_progress to avoid note_mouse_highlight glitch with GC.
1412 * frame.h (FRAME_MOUSE_UPDATE): New macro.
1413 * msdos.c (IT_frame_up_to_date): Use it here...
1414 * w32term.c (w32_frame_up_to_date): ...here...
1415 * xterm.c (XTframe_up_to_date): ...and here...
1416 * nsterm.m (ns_frame_up_to_date): ...but not here.
1417 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
1418 Adjust users.
1419 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
1420 Do not check whether GC is in progress.
1421
6ceeb5f1
DA
14222012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
1423
1424 * xdisp.c (window_buffer_changed): New function.
1425 (update_menu_bar, update_tool_bar): Use it to
1426 simplify large 'if' statements.
1427 (redisplay_internal): Generalize commonly used
1428 'tail' and 'frame' local variables.
1429
ec84768f
EZ
14302012-11-22 Eli Zaretskii <eliz@gnu.org>
1431
1432 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
1433 with Windows system header.
1434
9239d970
PE
14352012-11-21 Paul Eggert <eggert@cs.ucla.edu>
1436
1437 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
1438 * alloc.c: Assume unistd.h exists.
1439 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
1440 * sysdep.c (get_current_dir_name): Assume getcwd exists.
1441 (getwd) [USG]: Remove; no longer needed.
1442 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
1443 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
1444 * w32.h (getcwd): Remove decl.
1445
954bba56
SM
14462012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
1447
1448 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
1449 Make it set selected_window as well.
1450 (update_tool_bar): Use it.
1451
6ef2e5ef 14522012-11-21 Ken Brown <kbrown@cornell.edu>
4ffea447
KB
1453
1454 * emacs.c (main): Set the G_SLICE environment variable for all
1455 Cygwin builds, not just GTK builds. See
1456 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
1457
6ef2e5ef 14582012-11-21 Eli Zaretskii <eliz@gnu.org>
88c4a13c
EZ
1459
1460 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
1461 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
1462 Define for the MSVC compiler.
1463
6ef2e5ef 1464 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
273ac8d1
EZ
1465
1466 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
1467 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
1468 dostounix_filename. Prevents crashes down the road, because
26ec1f49
SM
1469 dostounix_filename assumes it gets a unibyte string.
1470 Reported by Michel de Ruiter <michel@sentient.nl>, see
273ac8d1
EZ
1471 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
1472
eadf1faa
SM
14732012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
1474
1475 Conflate Qnil and Qunbound for `symbol-function'.
1476 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
1477 * lread.c (init_obarray): Set `function' fields to Qnil.
1478 * eval.c (Fcommandp): Ignore Qunbound.
1479 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
1480 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
1481 Test NILP rather than Qunbound.
1482 (Ffmakunbound): Set to Qnil.
1483 (Fsymbol_function): Never signal an error.
1484 (Finteractive_form): Ignore Qunbound.
1485
b83fdfa9
PE
14862012-11-20 Paul Eggert <eggert@cs.ucla.edu>
1487
1488 * eval.c (interactive_p): Remove no-longer-used decl.
1489
952580c5
DA
14902012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
1491
1492 * xdisp.c (buffer_shared): Adjust comment.
1493 (buffer_shared_and_changed): New function.
1494 (prepare_menu_bars, redisplay_internal): Use it to
1495 decide whether all windows or frames should be updated.
ea6de9b1
DA
1496 (window_outdated): New function.
1497 (text_outside_line_unchanged_p, redisplay_window): Use it.
1498 (redisplay_internal): Likewise. Fix indentation.
952580c5 1499
23ba2705
SM
15002012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
1501
1502 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
1503 (syms_of_eval): Remove corresponding defsubr.
1504 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
1505
6e9f7997
DC
15062012-11-19 Daniel Colascione <dancol@dancol.org>
1507
1508 * w32fns.c (Fx_file_dialog):
1509 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
1510 cygwin_convert_file_name*.
1511
1512 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
1513 Rename cygwin_convert_path* to cygwin_convert_file_name*.
1514
552a1590
PE
15152012-11-18 Paul Eggert <eggert@cs.ucla.edu>
1516
1517 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
1518
2ac9538d 15192012-11-18 Eli Zaretskii <eliz@gnu.org>
d8715cdf
EZ
1520
1521 * w32select.c: Include w32common.h before w32term.h, so that
1522 windows.h gets included before w32term.h uses some of its
1523 features, see below.
1524
23ba2705
SM
1525 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
1526 New typedefs.
1527 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
1528 New prototypes.
d8715cdf
EZ
1529 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
1530
2ac9538d 15312012-11-18 Jan Djärv <jan.h.d@swipnet.se>
7436fc63
JD
1532
1533 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
1534 (ns_select): Return at once if events are held (Bug#12834).
1535
2ac9538d 15362012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
86dcf21c 1537
1538 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
1539 Needed following 2012-10-20 change. (Bug#12902)
1540
c1f7ba3a
JB
15412012-11-18 Juanma Barranquero <lekktu@gmail.com>
1542
1543 * w32proc.c (waitpid): Remove unused label get_result.
1544
a75ce9d3
JB
15452012-11-17 Juanma Barranquero <lekktu@gmail.com>
1546
1547 * makefile.w32-in (SYSWAIT_H): New macro.
1548 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
1549 ($(BLD)/sysdep.$(O)): Update dependencies.
1550
49cdacda
PE
15512012-11-17 Paul Eggert <eggert@cs.ucla.edu>
1552
1553 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
1554 * callproc.c (relocate_fd): Assume F_DUPFD.
1555 * emacs.c, term.c (O_RDWR): Remove.
1556 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
1557 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
1558 * nsterm.m: Assume <fcntl.h> exists.
1559 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
1560 (create_pty, Fmake_network_process, server_accept_connection)
1561 (wait_reading_process_output, init_process_emacs):
1562 Assume O_NONBLOCK.
1563 (wait_reading_process_output): Put in a special case for WINDOWSNT
1564 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
1565 It's not clear this is needed, but it's a more-conservative change.
1566 (create_process): Assume FD_CLOEXEC.
1567 (create_process, create_pty): Assume O_NOCTTY.
1568 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
1569 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
1570 Omit if not DOS_NT, since F_GETFL is not defined there.
1571 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
1572 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
1573 (O_NOCTTY): Remove.
1574 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
1575 lack it, since gnulib guarantees this.
1576 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
1577
22bae83f
EZ
15782012-11-17 Eli Zaretskii <eliz@gnu.org>
1579
6ad30855
EZ
1580 * w32.c (faccessat): Pretend that directories have the execute bit
1581 set. Emacs expects that, e.g., in files.el:cd-absolute.
1582
22bae83f
EZ
1583 * w32proc.c (create_child): Don't clip the PID of the child
1584 process to fit into an Emacs integer, as this is no longer a
1585 restriction.
1586 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
1587 reaping only the process specified by PID argument, if that is
1588 positive. Use PID instead of dead_child to know which process to
1589 reap. Wait for the child to die only if WNOHANG is not in
1590 OPTIONS.
1591 (sys_select): Don't set dead_child.
1592
1593 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
1594 as it is no longer needed.
1595
1596 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
1597 no longer needed.
1598 (record_child_status_change): Remove the setting of
1599 record_at_most_one_child for the !WNOHANG case.
1600
a631d0e0
PE
16012012-11-17 Paul Eggert <eggert@cs.ucla.edu>
1602
1603 Fix problems in ns port found by static checking.
1604 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
1605 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
1606 not to process group.
1607 (ns_select): Use emacs_write, not write, as that's more robust
1608 in the presence of signals.
1609 (fd_handler:): Check for read errors.
1610
d56f2e49
GM
16112012-11-16 Glenn Morris <rgm@gnu.org>
1612
1613 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
1614
96e05507 16152012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
5c2a7148
SM
1616
1617 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
1618
96e05507 16192012-11-16 Eli Zaretskii <eliz@gnu.org>
730b2d8f
EZ
1620
1621 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
1622 use the same value of thread handle.
1623 (start_timer_thread): If the timer thread exited (due to error),
1624 clean up by closing the two handles it used. Duplicate the caller
1625 thread's handle here, so it gets duplicated only once, when
1626 launching the timer thread. Set priority of the timer thread, not
1627 the caller thread.
1628 (getitimer): Don't duplicate the caller thread's handle here.
1629 (Bug#12832)
1630
96e05507 16312012-11-16 Jan Djärv <jan.h.d@swipnet.se>
f99c65e5
JD
1632
1633 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
1634 called (Bug#12834).
1635
3d082a26
PE
16362012-11-16 Paul Eggert <eggert@cs.ucla.edu>
1637
1638 Remove no-longer-used pty_max_bytes variable.
1639 * process.c (pty_max_bytes): Remove; unused.
1640 (send_process): Do not set it.
1641
b72c161c
JB
16422012-11-15 Juanma Barranquero <lekktu@gmail.com>
1643
1644 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
1645 Update dependencies.
1646
bf20ea80
PE
16472012-11-15 Paul Eggert <eggert@cs.ucla.edu>
1648
1649 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
1650 This follows up on the 2012-09-29 patch that removed indirection
1651 for the 'function' field. Reported by Sergey Vinokurov in
1652 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
1653
14f20728
EZ
16542012-11-14 Eli Zaretskii <eliz@gnu.org>
1655
1656 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
1657 different name, as the MS runtime does not have such a function,
1658 and probably never will.) All callers changed. Ignore DIRFD
1659 value if PATH is an absolute file name, to match Posix spec
1660 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
1661 symlinks.
1662
77731919
DA
16632012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
1664
1665 * xdisp.c (echo_area_display, redisplay_internal):
1666 Omit redundant check whether frame_garbaged is set.
1667
73dcdb9f
PE
16682012-11-14 Paul Eggert <eggert@cs.ucla.edu>
1669
1670 Use faccessat, not access, when checking file permissions (Bug#12632).
1671 This fixes a bug that has been present in Emacs since its creation.
1672 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
1673 which must set some sort of record. (Torek's bug report was against
1674 a predecessor of GNU Emacs, but GNU Emacs happened to have the
1675 same common flaw.) See Torek's Usenet posting
1676 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
1677 Posted: Fri Apr 8 14:18:56 1983.
1678 * Makefile.in (LIB_EACCESS): New macro.
1679 (LIBES): Use it.
1680 * callproc.c (init_callproc):
1681 * charset.c (init_charset):
1682 * fileio.c (check_existing, check_executable, check_writable)
1683 (Ffile_readable_p):
1684 * lread.c (openp, load_path_check):
1685 * process.c (allocate_pty):
1686 * xrdb.c (file_p):
1687 Use effective UID when checking permissions, not real UID.
1688 * callproc.c (init_callproc):
1689 * charset.c (init_charset):
1690 * lread.c (load_path_check, init_lread):
1691 Test whether directories are accessible, not merely whether they exist.
1692 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
1693 * fileio.c (check_existing, check_executable, check_writable)
1694 (Ffile_readable_p):
1695 Use symbolic names instead of integers for the flags, as they're
1696 portable now.
1697 (check_writable): New arg AMODE. All uses changed.
1698 Set errno on failure.
1699 (Ffile_readable_p): Use faccessat, not stat + open + close.
1700 (Ffile_writable_p): No need to call check_existing + check_writable.
1701 Just call check_writable and then look at errno. This saves a syscall.
1702 dir should never be nil; replace an unnecessary runtime check
1703 with an eassert. When checking the parent directory of a nonexistent
1704 file, check that the directory is searchable as well as writable, as
1705 we can't create files in unsearchable directories.
1706 (file_directory_p): New function, which uses 'stat' on most platforms
1707 but faccessat with D_OK (for efficiency) if WINDOWSNT.
1708 (Ffile_directory_p, Fset_file_times): Use it.
1709 (file_accessible_directory_p): New function, which uses a single
1710 syscall for efficiency.
1711 (Ffile_accessible_directory_p): Use it.
1712 * xrdb.c (file_p): Use file_directory_p.
1713 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
1714 * lread.c (openp): When opening a file, use fstat rather than
1715 stat, as that avoids a permissions race. When not opening a file,
1716 use file_directory_p rather than stat.
1717 (dir_warning): First arg is now a usage string, not a format.
1718 Use errno. All uses changed.
1719 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
1720 that merely introduced a race.
1721 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
1722 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
1723 and similarly for the other O_* flags.
1724 * w32.c (sys_faccessat): Rename from sys_access and switch to
1725 faccessat's API. All uses changed.
1726 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
1727 (magic_db): Rename from magic_file_p.
1728 (magic_db, search_magic_path): Return an XrmDatabase rather than a
1729 char *, so that we don't have to test for file existence
1730 separately from opening the file for reading. This removes a race
1731 fixes a permission-checking problem, and simplifies the code.
1732 All uses changed.
1733 (file_p): Remove; no longer needed.
1734
2a14f83b
DA
17352012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
1736
1737 Omit glyphs initialization at startup.
1738 * dispnew.c (glyphs_initialized_initially_p): Remove.
1739 (adjust_frame_glyphs_initially): Likewise. Adjust users.
1740 (Fredraw_frame): Move actual code from here...
c7085245 1741 (redraw_frame): ...to here. Add eassert. Adjust comment.
2a14f83b
DA
1742 (Fredraw_display): Use redraw_frame.
1743 * xdisp.c (clear_garbaged_frames): Likewise.
1744
f78ee6af 17452012-11-13 Eli Zaretskii <eliz@gnu.org>
32520273
EZ
1746
1747 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
1748 passed to pint2str and pint2hrstr to be at most the size of the
1749 frame's decode_mode_spec_buffer. This avoids crashes with very
1750 large values of FIELD_WIDTH argument to decode_mode_spec.
1751 (Bug#12867)
1752
b95a9c0c
PE
17532012-11-13 Paul Eggert <eggert@cs.ucla.edu>
1754
1755 Fix a race with verify-visited-file-modtime (Bug#12863).
1756 Since at least 1991 Emacs has ignored an mtime difference of no
1757 more than one second, but my guess is that this was to work around
1758 file system bugs that were fixed long ago. Since the race is
1759 causing problems now, let's remove that code.
1760 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
1761 whose time stamp is off by no more than a second. Insist that the
1762 file time stamps match exactly.
1763
be49ba74
DA
17642012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
1765
1766 * frame.h (struct frame): Convert external_tool_bar member to
1767 1-bit unsigned bitfield.
1768 * termhooks.h (struct terminal): Remove mouse_moved member since
1769 all users are long dead. Adjust comment on mouse_position_hook.
1770
5b04e9f9
DA
17712012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
1772
1773 Simplify by using FOR_EACH_FRAME here and there.
1774 * frame.c (next_frame, prev_frame, other_visible_frames)
1775 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
1776 * w32term.c (x_window_to_scroll_bar): Likewise.
1777 * window.c (window_list): Likewise.
1778 * xdisp.c (x_consider_frame_title): Likewise.
1779 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
1780 * xfns.c (x_window_to_frame, x_any_window_to_frame)
1781 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
1782 * xmenu.c (menubar_id_to_frame): Likewise.
1783 * xselect.c (frame_for_x_selection): Likewise.
1784 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
1785 (x_window_to_menu_bar): Likewise.
1786 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
1787
76ae24d7
PE
17882012-11-12 Paul Eggert <eggert@cs.ucla.edu>
1789
12cc4337
PE
1790 * data.c (Qdefalias_fset_function): Now static.
1791
76ae24d7
PE
1792 Another tweak to vectorlike_header change.
1793 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
1794 Remove, and replace all uses with ...
1795 (next_in_free_list, set_next_in_free_list):
1796 New functions, which respect C's aliasing rules better.
1797
1479c557
PE
17982012-11-11 Paul Eggert <eggert@cs.ucla.edu>
1799
1800 * window.c (list4i): Rename from 'quad'. All uses changed.
1801 Needed because <sys/types.h> defines 'quad' on Solaris 10.
1802
11235c03
JB
18032012-11-11 Juanma Barranquero <lekktu@gmail.com>
1804
1805 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
1806 warning about mixing declarations and code in ISO C90.
1807
6baf66d5 18082012-11-10 Martin Rudalics <rudalics@gmx.at>
fdaf534a
MR
1809
1810 * window.c (Fsplit_window_internal): Set combination limit of
1811 new parent window to t iff Vwindow_combination_limit is t;
1812 fixing a regression introduced with the change from 2012-09-22.
6baf66d5 1813 (Fset_window_combination_limit): Fix doc-string.
fdaf534a 1814
6baf66d5 18152012-11-10 Eli Zaretskii <eliz@gnu.org>
acf93bcf
EZ
1816
1817 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
1818 amount when the scroll margins are too large. When scrolling
1819 backwards in the buffer, give up if cannot reach point or the
23ba2705
SM
1820 scroll margin within a reasonable number of screen lines.
1821 Fixes point position in window under scroll-up/down-aggressively when
acf93bcf
EZ
1822 point is positioned many lines beyond the window top/bottom.
1823 (Bug#12811)
1824
508f51f5
EZ
1825 * ralloc.c (relinquish): If real_morecore fails to return memory
1826 to the system, don't crash; instead, leave the last heap
1827 unchanged and return. (Bug#12774)
1828
32e5c58c
SM
18292012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
1830
1831 * lisp.h (AUTOLOADP): New macro.
1832 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
1833 * data.c (Ffset): Remove special ad-advice-info handling.
1834 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
1835 (Fsubr_arity): CSE.
1836 (Finteractive_form): Simplify.
1837 (Fquo): Don't insist on having at least 2 arguments.
1838 (Qdefalias_fset_function): New var.
1839
719b0aa5
JD
18402012-11-09 Jan Djärv <jan.h.d@swipnet.se>
1841
4ab15c3e
JD
1842 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
1843
719b0aa5
JD
1844 * nsfont.m (Qcondensed, Qexpanded): New variables.
1845 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
1846 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
1847
535cc8e9
DA
18482012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
1849
1850 Fix recently introduced crash on MS-Windows (Bug#12839).
1851 * w32term.h (struct scroll_bar): Use convenient header.
1852 (SCROLL_BAR_VEC_SIZE): Remove.
1853 * w32term.c (x_scroll_bar_create): Use VECSIZE.
1854
7d377c48
DA
18552012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
1856
1857 Tweak last vectorlike_header change.
1858 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
1859 vectorlike object on the free list. This is introduced to avoid
1860 some (but not all) pointer casting and aliasing problems, see
1861 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
1862 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
1863 objects.
1864 (xvectype, xvecsize): Use them to examine Lisp_Object values.
1865
7ad27466
JD
18662012-11-09 Jan Djärv <jan.h.d@swipnet.se>
1867
32e5c58c 1868 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
7ad27466
JD
1869 been removed, so remove them here also.
1870
57618ecf
SM
18712012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
1872
1873 * doc.c (Fdocumentation): Handle new property
1874 dynamic-docstring-function to replace the old ad-advice-info.
1875
53371430
PE
18762012-11-09 Paul Eggert <eggert@cs.ucla.edu>
1877
1878 * fns.c (Qeql, hashtest_eq): Now static.
1879
61ddb1b9
SM
18802012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1881
1882 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
1883 * fns.c (hashfn_eq, hashfn_eql, sxhash):
1884 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
1885 * buffer.c (compare_overlays): Use XLI rather than XHASH.
1886
04a2d0d3
PE
18872012-11-08 Paul Eggert <eggert@cs.ucla.edu>
1888
1889 Use same hash function for hashfn_profiler as for hash_string etc.
1890 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
1891 * lisp.h (sxhash_combine): New inline function, with the contents
1892 of the old SXHASH_COMBINE.
1893 * profiler.c (hashfn_profiler): Use it, instead of having a
1894 special hash function containing a comparison that always yields 1.
1895
de5ef41a
SM
18962012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1897
1898 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
1899 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
1900 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
1901 Remove unused vars.
1902
a23c4171
JD
19032012-11-08 Jan Djärv <jan.h.d@swipnet.se>
1904
1905 * image.c (xpm_make_color_table_h): Fix compiler error because
1906 make_hash_table changed.
1907
0b59090b 19082012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
074d7bb0
JD
1909
1910 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
1911
b7432bb2
SM
19122012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1913
1914 Use ad-hoc comparison function for the profiler's hash-tables.
1915 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
1916 (make_log): Use them.
1917 (handle_profiler_signal): Don't inhibit quit any longer since we don't
1918 call Fequal any more.
1919 (Ffunction_equal): New function.
1920 (cmpfn_profiler, hashfn_profiler): New functions.
1921 (syms_of_profiler): Initialize them.
1922 * lisp.h (struct hash_table_test): New struct.
1923 (struct Lisp_Hash_Table): Use it.
1924 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
1925 * fns.c (make_hash_table): Take a struct to describe the test.
1926 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
1927 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
1928 (hash_lookup, hash_remove_from_table): Move assertion checking of
1929 hashfn result here. Check hash-equality before calling cmpfn.
1930 (Fmake_hash_table): Adjust call to make_hash_table.
1931 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
1932 (syms_of_fns): Initialize them.
1933 * emacs.c (main): Move syms_of_fns earlier.
1934 * xterm.c (syms_of_xterm):
1935 * category.c (hash_get_category_set): Adjust call to make_hash_table.
1936 * print.c (print_object): Adjust to new hash-table struct.
1937 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
1938
88002743
EZ
19392012-11-08 Eli Zaretskii <eliz@gnu.org>
1940
1941 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
1942 value of w32-scroll-lock-modifier is neither nil nor one of the
1943 known key modifiers. (Bug#12806)
1944
914adc42
DA
19452012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
1946
1947 Shrink struct vectorlike_header to the only size field.
1948 * lisp.h (enum pvec_type): Avoid explicit enum member values.
1949 Adjust comment.
1950 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
1951 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
1952 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
1953 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
1954 information from the vector header. Adjust comment.
1955 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
1956 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
1957 layout.
1958 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
1959 (struct vectorlike_header): Remove next member. Adjust comment.
1960 (struct Lisp_Subr): Add convenient header. Adjust comment.
1961 (allocate_pseudovector): Adjust prototype.
1962 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
1963 (sweep_string, lisp_malloc): Remove useless prototypes.
1964 (enum mem_type): Adjust comment.
1965 (NEXT_IN_FREE_LIST): New macro.
1966 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
1967 (Fmake_bool_vector): Likewise.
1968 (struct large_vector): New type to represent allocation unit for
1969 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
1970 (large_vectors): Change type to struct large_vector.
1971 (allocate_vector_from_block): Simplify.
1972 (PSEUDOVECTOR_NBYTES): Replace with...
1973 (vector_nbytes): ...new function. Adjust users.
1974 (sweep_vectors): Adjust processing of large vectors.
1975 (allocate_vectorlike): Likewise.
1976 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
1977 Add easserts. Adjust XSETPVECTYPESIZE usage.
1978 (allocate_buffer): Use BUFFER_PVEC_INIT.
1979 (live_vector_p): Adjust to match large vector.
1980 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
1981 * buffer.h (struct buffer): Add next member.
1982 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
1983 New macros.
1984 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
1985 * fns.c (internal_equal): Adjust to match enum pvec_type change.
1986 (copy_hash_table): Adjust to match vector header change.
1987 * lread.c (defsubr): Use XSETPVECTYPE.
1988 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
1989 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
1990 (xvecsize): New command.
1991
c66f21ea
DA
19922012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
1993
1994 * keyboard.c (event_to_kboard): Do not dereference
1995 frame_or_window field of SELECTION_REQUEST_EVENT
1996 and SELECTION_CLEAR_EVENT events (Bug#12814).
1997 * xterm.h (struct selection_input_event): Adjust comment.
1998
eb147960
EZ
19992012-11-07 Eli Zaretskii <eliz@gnu.org>
2000
dab72075
EZ
2001 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
2002 such as Scroll Lock, if the respective keys are treated as
2003 function keys, not as modifiers. This avoids destroying non-ASCII
6b064c16 2004 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
eb147960 2005
5890e400
DA
20062012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
2007
2008 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
2009
b6b3b294
PE
20102012-11-06 Paul Eggert <eggert@cs.ucla.edu>
2011
2012 Restore some duplicate definitions (Bug#12814).
2013 This undoes part of the 2012-11-03 changes. Some people build
2014 with plain -g rather than with -g3, and they need the duplicate
2015 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
2016 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
2017 Define as macros, as well as as enums or as constants.
2018
e770aad5
JD
20192012-11-06 Jan Djärv <jan.h.d@swipnet.se>
2020
2021 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
2022 to keypad keys (Bug#12816).
2023
68f8f1c0
PE
20242012-11-06 Paul Eggert <eggert@cs.ucla.edu>
2025
2026 Minor adjustments of recently-changed frame functions.
2027 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
2028 known to be a frame (we're in the FRAMEP branch).
2029 * lisp.h (Qframep): Remove decl. frame.h declares this.
2030 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
2031 since they're meant for Lisp fixnum values.
2032
72f94d4b
DA
20332012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
2034
2035 * window.c (Fwindow_combination_limit): Revert to the only
2036 required argument and adjust docstring as suggested in
2037 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
2038 by Martin Rudalics <rudalics@gmx.at>.
2039
d9f07150
DA
20402012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
2041
2042 Widely used frame validity and checking functions.
2043 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
2044 * frame.c (decode_live_frame, decode_any_frame): New functions.
2045 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
2046 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
2047 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
2048 (Fframe_pointer_visible_p): Use decode_any_frame.
2049 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
2050 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
2051 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
2052 (Fframe_focus): Likewise. Allow zero number of arguments.
2053 Adjust docstring.
2054 (frame_buffer_list, frame_buffer_predicate): Remove.
2055 * lisp.h (frame_buffer_predicate): Remove prototype.
2056 * buffer.c (Fother_buffer): Use decode_any_frame.
2057 * xdisp.c (Ftool_bar_lines_needed): Likewise.
2058 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
2059 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
2060 (Fclose_font, Ffont_info): Use decode_live_frame.
2061 * fontset.c (check_fontset_name): Likewise.
2062 * terminal.c (Fframe_terminal): Likewise.
2063 * w32fns.c (check_x_frame): Likewise.
2064 * window.c (Fminibuffer_window, Fwindow_at)
2065 (Fcurrent_window_configuration): Likewise.
2066 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
2067 Likewise. Allow zero number of arguments. Adjust docstring.
2068 * dispnew.c (Fredraw_frame): Likewise.
2069 * xfaces.c (frame_or_selected_frame): Remove.
2070 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
2071 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
2072 (Fframe_face_alist): Use decode_live_frame.
2073 * xfns.c (check_x_frame): Likewise.
2074
89bc0592
DA
20752012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
2076
2077 * window.c (quad): New function.
2078 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
2079 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
2080 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
2081 (Fwindow_line_height): Use it.
2082 (Fwindow_fringes): Use list3.
2083 (Fwindow_scroll_bars): Use list4.
2084 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
2085 (Fwindow_combination_limit): Allow zero number of arguments.
2086
c8e3a9c3
EZ
20872012-11-05 Eli Zaretskii <eliz@gnu.org>
2088
2089 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
2090
8e2417bf 2091 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
c8e3a9c3 2092 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
ae600a8e 2093 file descriptor 2 for standard error. (Bug#12805)
c8e3a9c3 2094
209c6a58
CY
20952012-11-05 Chong Yidong <cyd@gnu.org>
2096
2097 * process.c (wait_reading_process_output): Revert previous change.
2098
8148369c
PE
20992012-11-05 Paul Eggert <eggert@cs.ucla.edu>
2100
dd0333b6
PE
2101 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
2102 This removes code that has been obsolete since around 1990.
2103 * callproc.c (Fcall_process):
2104 * emacs.c (main):
2105 * process.c (create_process):
2106 * term.c (dissociate_if_controlling_tty):
2107 Assume setsid exists.
2108 * callproc.c (child_setup): Assume setpgid exists and behaves as
2109 per POSIX.1-1988 or later.
2110 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
2111 * emacs.c (shut_down_emacs):
2112 * sysdep.c (sys_suspend, init_foreground_group):
2113 Assume getpgrp behaves as per POSIX.1-1998 or later.
2114 * msdos.c (setpgrp): Remove.
2115 (tcgetpgrp, setpgid, setsid): New functions.
2116 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
2117 * term.c (no_controlling_tty): Remove; unused.
2118 * w32proc.c (setpgrp): Remove.
2119 (setsid, tcgetpgrp): New functions.
2120
8148369c
PE
2121 Simplify by assuming __fpending.
2122 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
2123 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
2124 Do not assume that __fpending's result fits in int.
2125
76abf5e5
PE
21262012-11-04 Paul Eggert <eggert@cs.ucla.edu>
2127
06b63c9b
PE
2128 Remove EMACS_OUTQSIZE+sleep hack.
2129 * dispnew.c (update_frame_1): Remove hack for terminals slower
de5ef41a
SM
2130 than 2400 bps, which throttled Emacs by having it sleep.
2131 This code hasn't worked since at least 2007, when the multi-tty stuff
06b63c9b
PE
2132 was added, and anyway those old terminals are long dead.
2133 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
2134 without the dispnew.c change, as dispnew.c doesn't include systty.h.
2135
76abf5e5
PE
2136 Fix data-loss with --version (Bug#9574).
2137 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
2138 as we can't assume that emacs_strerror is initialized, and strerror
2139 is good enough here.
2140 (main): Invoke atexit earlier, to catch earlier instances of
2141 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
2142
8f31e74b
MM
21432012-11-04 Michael Marchionna <tralfaz@pacbell.net>
2144
2145 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
2146 (keyDown): Remap keypad keys to X11 virtual key codes.
2147
0d879dca
PE
21482012-11-03 Paul Eggert <eggert@cs.ucla.edu>
2149
7ccfb720
PE
2150 Fix data-loss with --batch (Bug#9574).
2151 * emacs.c: Include <close-stream.h>.
2152 (close_output_streams): New function.
2153 (main): Pass it to atexit, so that Emacs closes stdout and stderr
2154 and handles errors appropriately.
2155 (Fkill_emacs): Don't worry about flushing, as close_output_stream
2156 does that now.
2157
0b3d4a47
PE
2158 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
2159 The symptom is a diagnostic "GLib-WARNING **: In call to
2160 g_spawn_sync(), exit status of a child process was requested but
2161 SIGCHLD action was set to SIG_IGN and ECHILD was received by
2162 waitpid(), so exit status can't be returned." The diagnostic
2163 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
2164 The real bug is a race condition between Emacs and glib: Emacs
2165 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
2166 so that glib can't find it. Work around the bug by invoking
2167 waitpid only on subprocesses that Emacs itself creates.
2168 * process.c (create_process, record_child_status_change):
2169 Don't use special value -1 in pid field, as the caller now must
de5ef41a
SM
2170 know the pid rather than having the callee infer it.
2171 The inference was sometimes incorrect anyway, due to another race.
0b3d4a47
PE
2172 (create_process): Set new 'alive' member if child is created.
2173 (process_status_retrieved): New function.
2174 (record_child_status_change): Use it.
2175 Accept negative 1st argument, which means to wait for the
2176 processes that Emacs already knows about. Move special-case code
2177 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
2178 processes that have already been waited for, by testing and
2179 clearing new 'alive' member.
2180 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
2181 now does this internally.
2182 (handle_child_signal): Let record_child_status_change do all
2183 the work, since we do not want to reap all exited child processes,
2184 only the child processes that Emacs itself created.
2185 * process.h (Lisp_Process): New boolean member 'alive'.
2186
0d879dca
PE
2187 Omit duplicate definitions no longer needed with gcc -g3.
2188 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
2189 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
2190 Define only as macros. There's no longer any need to also define
2191 these symbols as enums or as constants, since we now assume
2192 gcc -g3 when debugging.
2193
3478f4b5
EZ
21942012-11-03 Eli Zaretskii <eliz@gnu.org>
2195
2196 * lisp.mk: Adjust comments to the fact that term/internal is now
2197 loaded from loadup.el.
2198
2199 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
2200 (msdos_fatal_signal): New function.
2201 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
2202 its argument list.
2203
2204 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
2205 for GCC versions before 4.
2206 (emacs_raise): Define to call msdos_fatal_signal.
2207
2208 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
2209 iterator when starting in the middle of a display or overlay
2210 string. (Bug#12745)
2211
85fabcb7
CY
22122012-11-03 Chong Yidong <cyd@gnu.org>
2213
2214 * process.c (wait_reading_process_output): Clean up the last
2215 change.
2216
893cc455
CY
22172012-11-03 Jim Paris <jim@jtan.com> (tiny change)
2218
2219 * process.c (wait_reading_process_output): Avoid a race condition
2220 with SIGIO delivery (Bug#11536).
2221
0f7b074f
CY
22222012-11-03 Chong Yidong <cyd@gnu.org>
2223
2224 * buffer.c (cursor_type): Untabify docstring.
2225
3737fee7
DA
22262012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
2227
2228 * frame.h (struct frame): Drop can_have_scroll_bars member
2229 which is meaningless for a long time. Adjust comments.
2230 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
2231 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
2232
b6a9e8b1
DA
22332012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
2234
2235 * window.c (decode_next_window_args): Update window arg after
2236 calling decode_live_window and so fix crash reported at
2237 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
2238 by Juanma Barranquero <lekktu@gmail.com>.
2239 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
2240 * font.c (Ffont_at): Likewise.
2241
600d4768
JD
22422012-11-01 Jan Djärv <jan.h.d@swipnet.se>
2243
2244 * widget.c (resize_cb): New function.
2245 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
2246 (EmacsFrameResize): Check if all is up to date before changing frame
2247 size.
2248
1005b4b9
EZ
22492012-11-02 Eli Zaretskii <eliz@gnu.org>
2250
2251 Implement backtrace output for fatal errors on MS-Windows.
2252 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
2253 (BACKTRACE_LIMIT_MAX): New macro.
2254 (w32_backtrace): New function.
2255 (emacs_abort): Use w32_backtrace when the user chooses not to
2256 attach a debugger. Update the text of the abort dialog.
2257
b9e9df47
DA
22582012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
2259
2260 Window-related stuff cleanup here and there.
2261 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
2262 Use decode_any_window.
2263 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
2264 * xdisp.c (Fformat_mode_line): Likewise.
2265 * font.c (Ffont_at): Use decode_live_window.
2266 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
2267 * window.c (decode_next_window_args): Likewise.
2268 (decode_any_window): Remove static.
2269 * window.h (decode_any_window): Add prototype.
2270 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
2271 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
2272 respectively.
2273
2b371ff7
DA
22742012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
2275
2276 Remove pad from struct input_event.
2277 * termhooks.h (struct input_event): Remove padding field.
2278 Adjust comment.
2279 * keyboard.c (event_to_kboard): Simplify because frame_or_window
2280 member is never cons for a long time. Adjust comment.
2281 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
2282 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
2283 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
2284 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
2285
7e8b50d9
EZ
22862012-11-01 Eli Zaretskii <eliz@gnu.org>
2287
2288 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
2289
322aea6d
PE
22902012-10-31 Paul Eggert <eggert@cs.ucla.edu>
2291
2292 Fix crash when using Emacs as commit editor for git (Bug#12697).
2293 * callproc.c (setpgrp): Remove macro, as we now use setpgid
2294 and it is configured in conf_post.h.
2295 (Fcall_process): Don't invoke both setsid and setpgid; the former
2296 is enough, if it exists.
2297 * callproc.c (Fcall_process, child_setup):
2298 * process.c (create_process): Use setpgid.
2299 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
2300 for the real thing.
2301 * dispnew.c (init_display): Initialize the foreground group
2302 if we are running a tty display.
2303 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
2304 * lisp.h (init_foreground_group): New decl.
2305 * sysdep.c (inherited_pgroup): New static var.
2306 (init_foreground_group, tcsetpgrp_without_stopping)
2307 (narrow_foreground_group, widen_foreground_group): New functions.
2308 (init_sys_modes): Narrow foreground group.
2309 (reset_sys_modes): Widen foreground group.
2310
220cb2bd
MA
23112012-10-31 Michael Albinus <michael.albinus@gmx.de>
2312
2313 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
2314
218e997a
MR
23152012-10-31 Martin Rudalics <rudalics@gmx.at>
2316
2317 * minibuf.c (read_minibuf): Restore current buffer since
2318 choose_minibuf_frame calling Fset_frame_selected_window may
2319 change it (Bug#12766).
2320
02615da0
JD
23212012-10-30 Jan Djärv <jan.h.d@swipnet.se>
2322
2323 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
2324
aee5b18e
KH
23252012-10-30 Kenichi Handa <handa@gnu.org>
2326
2327 * font.c (Ffont_at): If WINDOW is specified and it is not
2328 displaying the current buffer, signal an error.
2329
ba116008
DC
23302012-10-29 Daniel Colascione <dancol@dancol.org>
2331
de5ef41a
SM
2332 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
2333 In preparation for fixing bug#12739, move these functions from
ba116008
DC
2334 here...
2335
2336 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
2337 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
2338 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 2339
640bf8ad
EZ
23402012-10-28 Eli Zaretskii <eliz@gnu.org>
2341
2342 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
2343 (timer_loop, getitimer, setitimer): Use it instead of
2344 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
2345 'clock'.
2346 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
2347 literal 10000.
2348
64ccff5f
JD
23492012-10-28 Jan Djärv <jan.h.d@swipnet.se>
2350
2351 * nsterm.m (NO_APPDEFINED_DATA): New define.
2352 (last_appdefined_event_data): New variable
2353 (last_appdefined_event): Remove.
2354 (ns_select): Initialize t from last_appdefined_event_data instead
2355 of [last_appdefined_event data1].
2356 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
2357 remove last_appdefined_event (Bug#12698).
2358
e483264c
SM
23592012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
2360
2361 * frame.c (x_set_font): Catch internal error.
2362
6c16c13e
EZ
23632012-10-27 Eli Zaretskii <eliz@gnu.org>
2364
e483264c
SM
2365 Avoid overflow in w32 implementation of interval timers.
2366 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
2367 actually executes.
2368 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
2369 'volatile ULONGLONG' types. All the other data which was
2370 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
2371 (GetThreadTimes_Proc): New typedef.
2372 (w32_get_timer_time): New function, returns a suitable time value
2373 for the timer.
2374 (timer_loop): Enter critical section when accessing ULONGLONG
2375 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
2376 atomic. Call 'w32_get_timer_time' instead of 'clock'.
2377 Remove unused variable.
6c16c13e
EZ
2378 (init_timers): Initialize s_pfn_Get_Thread_Times.
2379 (start_timer_thread): Don't assign itimer->caller_thread here.
2380 (getitimer): Assign itimer->caller_thread here.
2381 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 2382 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 2383
ccc83f50
EZ
23842012-10-26 Eli Zaretskii <eliz@gnu.org>
2385
2386 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
2387 mouse movement events if the menu bar is active. This avoids
2388 producing a busy "hour-glass" cursor by Windows if the mouse
2389 pointer is positioned over a tooltip shown for some menu item.
2390
69deda53
PE
23912012-10-25 Paul Eggert <eggert@cs.ucla.edu>
2392
2393 Don't assume process IDs fit in int.
2394 * emacs.c (shut_down_emacs) [!DOS_NT]:
2395 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
2396 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
2397 Use pid_t, not int, to store process IDs, as 'int'
2398 is not wide enough on a few platforms (e.g., AIX and IRIX).
2399
7e70a152
KH
24002012-10-23 Kenichi Handa <handa@gnu.org>
2401
2402 The following change is to make face-font-rescale-alist work
2403 correctly for non-ASCII fonts.
2404
2405 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
2406 (font_open_for_lface): Handle Vface_font_rescale_alist.
2407
49238e7f
CY
24082012-10-23 Chong Yidong <cyd@gnu.org>
2409
2410 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
2411
5ec86886
JD
24122012-10-21 Jan Djärv <jan.h.d@swipnet.se>
2413
ef446959
JD
2414 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
2415 for screen font.
2416 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
2417
5ec86886
JD
2418 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
2419 event (Bug#12681).
2420
ee7a418d
GM
24212012-10-21 Glenn Morris <rgm@gnu.org>
2422
2423 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
2424
4973679b
PE
24252012-10-20 Paul Eggert <eggert@cs.ucla.edu>
2426
2427 Port to OpenBSD 5.1.
2428 * frame.c (Fmouse_position, Fmouse_pixel_position):
2429 * xdisp.c (produce_stretch_glyph):
2430 Declare local vars only when they're needed.
2431 This is clearer and avoids a warning on OpenBSD about unused vars.
2432 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
2433 This is safer, and avoids OpenBSD warnings about unused vars.
2434 * keyboard.c (record_menu_key): Remove unnecessary decl.
2435 (poll_timer): Define only if POLL_FOR_INPUT is defined.
2436 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
2437 as our definition clashes with OpenBSD's.
2438 * xfaces.c (load_face_colors, check_lface_attrs)
2439 (get_lface_attributes_no_remap, get_lface_attributes)
2440 (lface_fully_specified_p, x_supports_face_attributes_p)
2441 (tty_supports_face_attributes_p, face_fontset, realize_face)
2442 (realize_x_face, realize_tty_face):
2443 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
2444 merely Lisp_Object *. This is more informative and avoids
2445 a warning on OpenBSD about accessing beyond an object's size.
2446
c664f463
CY
24472012-10-20 Chong Yidong <cyd@gnu.org>
2448
2449 * lread.c (Fload): Doc fix (Bug#12592).
2450
6ec83f92 24512012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
2452
2453 * font.c (Ffont_at): Fix previous change.
2454
d2824928
EZ
24552012-10-19 Eli Zaretskii <eliz@gnu.org>
2456
e483264c
SM
2457 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
2458 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
2459 for the reasons.
2460
d2824928
EZ
2461 * alloc.c (NSTATICS): Decrease to 0x800.
2462
f60d391f
SM
24632012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
2464
4a0e1924 2465 * fns.c (Fnreverse): Include the problem element when signaling an
f60d391f
SM
2466 error (bug#12677).
2467
1a9327d5
JD
24682012-10-18 Jan Djärv <jan.h.d@swipnet.se>
2469
2470 * nsterm.m (ns_select): Check writefds before call to
2471 FD_ISSET (Bug#12668).
2472
14145a1e
DC
24732012-10-18 Daniel Colascione <dancol@dancol.org>
2474
2475 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
2476 (staticpro): If we run out of staticpro slots, die with an
2477 informative error instead of just calling emacs_abort.
2478
1f76f6f5
MR
24792012-10-18 Martin Rudalics <rudalics@gmx.at>
2480
2481 Fix two flaws reported by Dmitry Antipov.
2482 * window.c (Ftemp_output_buffer_show): Remove.
2483 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
2484 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
2485
fcf14875
EZ
24862012-10-17 Eli Zaretskii <eliz@gnu.org>
2487
1f76f6f5
MR
2488 * makefile.w32-in ($(BLD)/w32.$(O)):
2489 ($(BLD)/vm-limit.$(O)):
2490 ($(BLD)/term.$(O)):
2491 ($(BLD)/unexw32.$(O)):
2492 ($(BLD)/fileio.$(O)):
a68089e4
EZ
2493 ($(BLD)/dispnew.$(O)): Update dependencies.
2494
2495 * w32term.h (w32_initialize_display_info, initialize_w32_display):
2496 Add prototypes.
2497
2498 * w32proc.c: Include ctype.h.
2499
2500 * w32.h (init_environment, check_windows_init_file)
2501 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
2502 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
2503 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
2504 (sys_link): Add prototypes.
2505
2506 * w32.c: Include w32select.h.
2507 (sys_access, e_malloc, sys_select): Add prototypes.
2508 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
2509
2510 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
2511
2512 * unexw32.c: Include lisp.h and w32.h.
2513
2514 * term.c [WINDOWSNT]: Include w32term.h.
2515
2516 * process.c [WINDOWSNT]: Add prototype of sys_select.
2517
2518 * fileio.c [WINDOWSNT]: Include w32.h.
2519
2520 * dispnew.c [WINDOWSNT]: Include w32.h.
2521
fcf14875
EZ
2522 * cygw32.c (Fcygwin_convert_path_to_windows)
2523 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
2524 Lisp_Object values. (Bug#12661)
2525
2526 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
2527 to Lisp_Object. (Bug#12661)
2528
fe0b1ec4
KH
25292012-10-17 Kenichi Handa <handa@gnu.org>
2530
2531 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
2532 invalidate.
2533
d556ebf9
DA
25342012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
2535
2536 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 2537 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 2538
f0863a54
DA
25392012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
2540
2541 Do not verify indirection counters of killed buffers (Bug#12579).
2542 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
2543 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
2544
12fbe755
DA
25452012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
2546
2547 * alloc.c (Fmake_byte_code): Fix typo in comment.
2548 * print.c (print_interval): Define as static to match prototype.
2549 * indent.c (disptab_matches_widthtab, recompute_width_table):
2550 Convert to eassert.
2551
61655b89
DA
25522012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
2553
2554 * editfns.c (get_system_name): Remove.
2555 * lisp.h (get_system_name): Remove prototype.
2556 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
2557 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
2558
9520f2f2
DC
25592012-10-15 Daniel Colascione <dancol@dancol.org>
2560
2561 * dbusbind.c: Add comment explaining reason for previous change.
2562
dca778d5
MR
25632012-10-15 Martin Rudalics <rudalics@gmx.at>
2564
2565 * window.c (Fwindow_end): Rewrite check whether cached position
2566 can be used (Bug#12600).
2567 (resize_frame_windows, grow_mini_window, shrink_mini_window):
2568 Set windows_or_buffers_changed.
2569
3e0341b0
DC
25702012-10-15 Daniel Colascione <dancol@dancol.org>
2571
2572 * dbusbind.c: Fix cygw32 build break when compiling with dbus
2573 enabled by undefining the symbol "interface", which the platform
2574 headers define to something incompatible.
2575
33d4113c
DC
25762012-10-14 Daniel Colascione <dancol@dancol.org>
2577
2578 * image.c (init_tiff_functions, init_imagemagick_functions)
2579 (init_svg_functions): Fix cygw32 build break by using these
2580 functions only when WINDOWSNT _and_ HAVE_NTGUI.
2581
a36fb15e
JD
25822012-10-14 Jan Djärv <jan.h.d@swipnet.se>
2583
2584 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
2585
537f336d
JD
25862012-10-13 Jan Djärv <jan.h.d@swipnet.se>
2587
2588 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
2589
0ba06a77
KH
25902012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
2591
2592 * coding.c (detect_coding): Set coding->id before calling
2593 this->detector.
2594
ce2fe65a
AS
25952012-10-13 Andreas Schwab <schwab@linux-m68k.org>
2596
2597 * fileio.c: Formatting fixes.
2598
d6453ce4
PE
25992012-10-13 Paul Eggert <eggert@cs.ucla.edu>
2600
2601 Fix some stat-related races.
2602 * fileio.c (Fwrite_region): Avoid race condition if a file is
2603 removed or renamed by some other process immediately after Emacs
2604 writes it but before Emacs stats it. Do not assume that stat (or
2605 fstat) succeeds.
2606 * image.c (slurp_file): Resolve the file name with fopen + fstat
2607 rather than stat + fopen.
2608 (pbm_read_file) [0]: Remove unused code with stat race.
2609 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
2610 Remove ineffective code with stat race.
2611
06485aa8
SM
26122012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
2613
2614 * doc.c (get_doc_string): Don't signal an error if the file is missing.
2615
167e3640
JD
26162012-10-12 Jan Djärv <jan.h.d@swipnet.se>
2617
2618 * nsterm.m (hold_event_q): New static variable.
2619 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
2620 ! q_event_ptr.
2621 (hold_event): New function.
2622 (ns_read_socket): If hold_event_q have events, store them and
2623 return (Bug#12384).
2624 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
2625 is zero (Bug#12384).
2626
c40239df
JB
26272012-10-12 Juanma Barranquero <lekktu@gmail.com>
2628
2629 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
2630
bb385a92
EZ
26312012-10-12 Eli Zaretskii <eliz@gnu.org>
2632
2a9f1099
EZ
2633 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
2634
bb385a92
EZ
2635 * fileio.c (check_existing): New function.
2636 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
2637 instead of calling 'stat', when what's needed is to check whether
2638 a file exists. This avoids expensive system calls on MS-Windows.
2639 (Bug#12587)
2640
8599b23a 2641 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
2642
2643 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
2644 determine whether a file exists and is not a directory.
2645
2646 * lisp.h (check_existing): Add prototype.
2647
2b9c2e68
JD
26482012-10-12 Jan Djärv <jan.h.d@swipnet.se>
2649
2650 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
2651
81749a23
GM
26522012-10-12 Glenn Morris <rgm@gnu.org>
2653
2654 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
2655
5253a5fd
SM
26562012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
2657
389a94a5
SM
2658 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
2659
5253a5fd
SM
2660 * eval.c (Fautoload): Remember previous autoload status in load-history.
2661
7cded46f
PE
26622012-10-11 Paul Eggert <eggert@cs.ucla.edu>
2663
2664 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
2665 * lread.c (load_each_byte, new_backquote_flag, readchar)
2666 (read_filtered_event, lisp_file_lexically_bound_p)
2667 (safe_to_load_version, Fload, complete_filename_p, openp)
2668 (build_load_history, readevalloop, read_escape, read1)
2669 (string_to_number, read_vector, read_list):
2670 * macros.c (Fstart_kbd_macro):
2671 * marker.c (CONSIDER):
2672 * menu.c (parse_single_submenu, digest_single_submenu)
2673 (find_and_return_menu_selection, Fx_popup_menu):
2674 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
2675 (Ftry_completion):
2676 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
2677 (ns_menu_show):
2678 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
2679 (xmenu_show, xdialog_show):
2680 Use bool for booleans.
2681 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
2682 as it's not a predicate. All uses changed. Omit unnecessary
2683 buffer termination.
2684
549c3414
DA
26852012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
2686
2687 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
2688 (save_excursion_restore): Do not restore mark if it was not saved.
2689
e85aafe7
PE
26902012-10-11 Paul Eggert <eggert@cs.ucla.edu>
2691
fd2f90cf
PE
2692 * marker.c (cached_modiff): EMACS_INT, not int.
2693
c1af190b
PE
2694 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
2695 instead of having a wrong decl.
e85aafe7
PE
2696 * nsmenu.m (waiting_for_input): Remove wrong decl.
2697
e738ca56
PE
26982012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2699
9fa1de30
PE
2700 keyboard.c, keymap.c: Use bool for booleans.
2701 * dispnew.c (sit_for): Distinguish between 3-way display_option
2702 and boolean do_display.
2703 * keyboard.c (single_kboard, this_command_key_count_reset)
2704 (waiting_for_input, echoing, immediate_quit, input_pending)
2705 (interrupt_input, interrupts_deferred, pop_kboard)
2706 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
2707 (command_loop_1, adjust_point_for_property)
2708 (safe_run_hooks_error, input_polling_used, read_char):
2709 (help_char_p, readable_events, kbd_buffer_events_waiting)
2710 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
2711 (lucid_event_type_list_p, get_input_pending):
2712 (gobble_input, menu_separator_name_p, menu_bar_item)
2713 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
2714 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
2715 (keyremap_step, test_undefined, read_key_sequence)
2716 (detect_input_pending, detect_input_pending_ignore_squeezables)
2717 (detect_input_pending_run_timers, requeued_events_pending_p)
2718 (quit_throw_to_read_char, Fset_input_interrupt_mode):
2719 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
2720 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
2721 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
2722 (accessible_keymaps_1, Fkey_description, push_key_description):
2723 (shadow_lookup, struct where_is_internal_data)
2724 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
2725 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
2726 (describe_map, describe_vector):
2727 * menu.c (single_menu_item):
2728 * nsmenu.m (ns_update_menubar):
2729 * process.c (wait_reading_process_output):
2730 * search.c (scan_buffer, scan_newline):
2731 Use bool for boolean.
2732 * keyboard.c (timers_run, swallow_events)
2733 (detect_input_pending_run_timers):
2734 * process.c (wait_reading_process_output):
2735 Use unsigned for counter where wraparound-on-overflow is desired,
2736 since unsigned is guaranteed to have that behavior and signed is not.
2737 (read_char): Use ptrdiff_t for string length.
2738 (get_input_pending): Remove first argument, since it was always
2739 the same pointer-to-int (now pointer-to-boolean) &input_pending,
2740 and behave as if it had that value. Return new value of
2741 input_pending. All callers changed.
2742 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
2743 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
2744 a string length.
2745 * keymap.c (push_key_description): Omit last arg, which was always 1.
2746 All callers changed.
2747
e738ca56
PE
2748 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
2749
29f21cdf
JB
27502012-10-10 Juanma Barranquero <lekktu@gmail.com>
2751
2752 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
2753 ($(BLD)/term.$(O)): Update dependencies.
2754
6aea7528
DA
27552012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
2756
2757 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
2758 * lisp.h (enum pvec_type): Adjust comments and omit explicit
2759 initializer for PVEC_NORMAL_VECTOR.
2760
5f3f57be
PE
27612012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2762
2763 Clean out old termopts cruft.
2764 * termopts.h (flow_control, meta_key): Remove unused decls.
2765 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
2766 Don't include termopts.h.
2767
3e98c68e
DA
27682012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
2769
2770 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
2771
77e344e5
PE
27722012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2773
2774 * commands.h (immediate_quit): Remove duplicate decl.
2775
5683d7cd
JD
27762012-10-09 Jan Djärv <jan.h.d@swipnet.se>
2777
2778 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
2779 caching.
2780 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 2781 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 2782
cf5fc6db
EZ
27832012-10-09 Eli Zaretskii <eliz@gnu.org>
2784
b15736e6
EZ
2785 * w32fns.c (w32_last_error): Change the return value to DWORD, to
2786 match what GetLastError returns. Explain why the function is
2787 needed.
2788
cf5fc6db
EZ
2789 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
2790 'is_tooltip_frame', to avoid confusion with its global namesake.
2791
f99714ce
DC
27922012-10-08 Daniel Colascione <dancol@dancol.org>
2793
2794 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
2795 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
2796 build that caused Emacs to display the hourglass cursor forever.
f99714ce 2797
fd59cb29
GM
2798 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
2799 which is broken under remote desktop, calculate the number of
2800 colors available for a display based on the display's number of
2801 planes and number of bits per pixel per plane. (bug#10397).
2802
62c480c9 28032012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 2804
62c480c9
JD
2805 * nsfont.m (Vfonts_in_cache): New variable.
2806 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
2807 are used. Add cached fonts to Vfonts_in_cache.
2808 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
2809
607446ba
JB
28102012-10-08 Juanma Barranquero <lekktu@gmail.com>
2811
fd5125ad
JB
2812 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
2813 in nt/config.nt.
46979e0b
JB
2814 (FONT_H): Define after FRAME_H.
2815 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
2816 Update dependencies.
fd5125ad 2817
607446ba
JB
2818 * w32term.c: Remove leftover declaration of keyboard_codepage.
2819
b6f4e300
EZ
28202012-10-08 Eli Zaretskii <eliz@gnu.org>
2821
c54ebba4
EZ
2822 * makefile.w32-in (FONT_H): Add $(FRAME_H).
2823 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
2824 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
2825 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
2826 ($(BLD)/unexw32.$(O)):
2827 ($(BLD)/w32.$(O)):
2828 ($(BLD)/w32console.$(O)):
2829 ($(BLD)/w32fns.$(O)):
2830 ($(BLD)/w32heap.$(O)):
2831 ($(BLD)/w32menu.$(O)):
15c720a3 2832 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 2833
b6f4e300
EZ
2834 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
2835 'const char *'.
2836 (x_to_w32_color): Don't modify the argument, modify a copy instead.
2837
501199a3
DC
28382012-10-08 Daniel Colascione <dancol@dancol.org>
2839
2840 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
2841 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
2842 accidental message numbering hole. Change other messages to
2843 match.
2844
2845 * w32select.h (HAVE_W32SELECT): Remove.
2846
2847 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 2848 w32common.h instead of w32heap.h.
501199a3
DC
2849
2850 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
2851 (get_allocation_unit, get_processor_type, get_w32_major_version)
2852 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
2853 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
2854 (OS_NT, os_subtype, cache_system_info): Move declarations to
2855 w32common.
2856
2857 * w32heap.c: Include w32common.h.
2858 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
2859 (w32_minor_version, w32_build_number, w32_subtype):
2860 Remove duplicate definitions.
501199a3
DC
2861
2862 * w32fns.c: Include w32common.h; include w32heap.h only in
2863 WINDOWSNT.
2864
2865 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
2866 Use `report_file_error' instead of `error' in order to better
2867 inform users of what went wrong. Increase NTGUI_UNICODE file
2868 dialog box file name length to 32k, the maximum allowed by the NT
2869 kernel.
2870
2871 * w32common.h: New file.
2872 (ROUND_UP, ROUND_DOWN, get_page_size)
2873 (get_allocation_unit, get_processor_type, get_w32_major_version)
2874 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
2875 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
2876 (OS_NT, os_subtype, cache_system_info): Move here.
2877
2878 * unexw32.c, unexcw.c: Include w32common.h.
2879
2880 * emacs.c (main): Use (defined (WINDOWSNT) || defined
2881 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
2882 to call syms_of_w32select.
2883
2884 * cygw32.h: Remove obsolete EXFUN declarations.
2885
2886 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
2887
2888 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
2889 of w32inevt.o from SOME_MACHINE_OBJECTS.
2890
93aa5c81
DC
28912012-10-08 Daniel Colascione <dancol@dancol.org>
2892
2893 * image.c: Permanent fix for JPEG compilation issue --- limit
2894 jpeglib `boolean' redefinition to Cygwin builds.
2895
d424f3d8
EZ
28962012-10-08 Eli Zaretskii <eliz@gnu.org>
2897
8ee4c6ce
EZ
2898 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
2899
d424f3d8
EZ
2900 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
2901 Cygwin.
2902
e08348a0
DC
29032012-10-08 Daniel Colascione <dancol@dancol.org>
2904
2905 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
2906 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
2907 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
2908 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
2909 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
2910 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
2911 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
2912 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
2913 now a supported configuration.
2914
2915 * Makefile.in: consolidate image variables into LIBIMAGE; add
8e2417bf 2916 W32_OBJ and W32_LIBS. Compile new files.
e08348a0
DC
2917
2918 * conf_post.h:
2919 (_DebPrint) declare tracing facility for W32 debugging. We need
2920 to unify tracing later.
2921
2922 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
2923 unconditional use of W32 Unicode functions. Cygwin runs only on
2924 100% Unicode operating systems.
2925
2926 * cygw32.c: New file. Define Cygwin-specific facilities.
2927 (Fcygwin_convert_path_to_windows)
2928 (Fcygwin_convert_path_from_windows): New user functions for
2929 accessing Cygwin path-munging routines.
2930
2931 * cygw32.h: New file.
2932 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
2933 UTF-16LE strings temporarily inside non-Lisp-visible string
2934 objects.
2935
2936 (w32_strerror): Just what it says on the tin.
2937
2938 * emacs.c: Make the NS fork-then-exec code for daemon-launching
2939 also run for Cygwin; both systems have the same problem with using
2940 GUI facilities in a forked child. Also call syms_of_cygw32,
2941 syms_of_w32select in correct places.
2942
2943 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
2944 needs fork-then-exec for daemon launching.
2945
2946 * font.h: Include frame.h.
2947
2948 * image.c: Use the image library cache machinery only when we're
2949 compiling for native WINDOWSNT; Cygwin can use shared libraries
2950 like any other Unixlike system.
2951
2952 * keyboard.c: Clarify a comment regarding the input loop.
2953
2954 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
2955 functions directly instead of trying to detect at runtime that our
2956 host operating system supports them. We make this change for two
2957 reasons: Cygwin lacks support for the multibyte character
2958 conversion functions used by the legacy menu code, and Cygwin
2959 never needs to rely on non-Unicode APIs.
2960
2961 * unexw32.c (hinst): Declare extern.
2962
2963 * w32.c: Change header order;
2964 (w32_strerror): Move to w32fns.c because we need it for
2965 non-WINDOWSNT builds.
2966
2967 * w32.h: Add #error macro to make sure we don't include w32.h for
2968 Cygwin builds. Remove w32select declarations.
2969
2970 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 2971 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
2972
2973 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
2974 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
2975 POSIXy alternative.
2976 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
2977 (w32_major_version, w32_minor_version, w32_build_number)
2978 (os_subtype, sound_type): Define here
2979 (w32_defined_color): Make color parameter const for consistency
2980 with other _defined_color functions.
2981 (w32_createwindow): Unconditionally call w32_init_class instead of
2982 doing so only when hprevinst is non-NULL. Plumbing hprevinst
2983 through the code is complex and unnecessary because class
2984 registration is practically free.
2985 (w32_name_of_message): New EMACSDEBUG-only function.
2986 (Fset_message_beep): Move here
2987 (Fx_open_connection): Require that the display name for Windows be
2988 "w32" for consistency, emacsclient disambiguation, and maybe, one
2989 day, multi-window-system support.
2990 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
2991 Cygwin files for W32 GUI facilities, since these clearly don't
2992 expect Cygwin names.
2993 (_DebPrint): Define.
2994 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
2995 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
2996 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
2997 (w32_last_error): Remove.
2998
2999 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
3000
3001 * w32heap.c (syspage_mask): Declare here.
3002 (cache_system_info): Remove.
3003
3004 * w32inevt.c (faked_key): Define globally, not statically.
3005 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
3006 (w32_console_toggle_lock_key): Move to w32fns.c.
3007
3008 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
3009
3010 * w32proc.c (_DebPrint): Move to w32fns.c.
3011 * w32select.c: Include string.h, stdio.h for Cygwin.
3012 * w32select.h: New File.
3013
3014 * w32term.c: Include io.h for non-CYGWIN builds; needed for
3015 get_osfhandle.
3016 (w32_message_fd): New variable. Under Cygwin, holds the file
3017 descriptor the system used to tell us about pending thread
3018 messages.
3019
3020 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
3021 that prevented compilation under non-WINDOWSNT systems.
3022
3023 (w32_initialize): Open /dev/windows and assign it to
3024 w32_message_fd. Provide w32 feature.
3025
3026 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
3027 (WM_EMACS_INPUT_READY): add.
3028 (prepend_msg, w32_message_fd): Declare globally.
3029
3030 * w32xfns.c:
3031 (keyboard_handle): Use only when WINDOWSNT.
3032 (notify_msg_ready): New function. Posts a message to the main
3033 thread's message queue under CYGWIN, which wakes up the main
3034 thread from select(2) by making the /dev/windows file descriptor
3035 ready. Under WINDOWSNT, it sets an event the same way the old
3036 code did.
3037
3038 (post, prepend_msg): Actually call notify_msg_ready instead of
3039 setting the input event directly.
3040
98daa893
EZ
30412012-10-07 Eli Zaretskii <eliz@gnu.org>
3042
3043 * ralloc.c (relinquish): If a heap is ready to be relinquished,
3044 but it still has blocs in it, don't return it to the system,
3045 instead of aborting. (Bug#12402)
3046
3bc0a2f7
JD
30472012-10-07 Jan Djärv <jan.h.d@swipnet.se>
3048
8ad5b73b 3049 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 3050
335f5ae4
JD
3051 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
3052 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
3053 (syms_of_nsterm): Remove comment about Panther and above for
3054 ns-antialias-text.
335f5ae4
JD
3055 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
3056 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
3057 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
3058
3059 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
3060 MAC_OS_X_VERSION_10_4.
3061
8ad5b73b
JD
3062 * nsmenu.m (fillWithWidgetValue:): Remove code for <
3063 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
3064
3065 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
3066
3067 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
3068 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
3069
3bc0a2f7
JD
3070 * nsterm.m (ns_in_resize): Remove (Bug#12479).
3071 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
3072 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
3073 Remove ns_in_resize check.
3bc0a2f7
JD
3074 (ns_clear_frame_area): Remove resize handle code.
3075
3076 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
3077 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
3078 Remove ns_in_resize check.
3bc0a2f7 3079
c622b48f
PE
30802012-10-07 Paul Eggert <eggert@cs.ucla.edu>
3081
3082 Improve sys_siglist detection.
3083 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
3084 defined as a macro, as is done in Solaris.
3085 (sys_siglist_entries): New macro.
3086 (save_strsignal): Use it.
3087 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
3088 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
3089
04fafa46
JD
30902012-10-06 Jan Djärv <jan.h.d@swipnet.se>
3091
3092 * nsfns.m (Fx_create_frame): Call x_default_parameter with
3093 fullscreen/Fullscreen.
3094
3095 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
3096 tobar_height is new.
3097
3098 * nsterm.m (x_make_frame_visible): Check for fullscreen.
3099 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
3100 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
3101 (windowDidResize:): Check for correct window if old style fullscreen.
3102 Capitalize word in comment. Remove incorrect comment.
3103 (initFrameFromEmacs:): tbar_height renamed tibar_height.
3104 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
3105 error in drawing background.
1f9f395d 3106 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
3107 Set toolbar values to zero, save old height in tobar_height.
3108 Restore tool bar height when leaving fullscreen.
3109 (canBecomeMainWindow): New function.
3110
c6e21c03
PE
31112012-10-06 Paul Eggert <eggert@cs.ucla.edu>
3112
3113 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
3114
0d9f584b
EZ
31152012-10-05 Eli Zaretskii <eliz@gnu.org>
3116
a65fbb5f
EZ
3117 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
3118
0d9f584b 3119 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
3120 that time stamps of directories could also be changed.
3121 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
3122 FILE_WRITE_ATTRIBUTES access rights.
3123
3124 * fileio.c (Fset_file_times): Special-case ignoring errors for
3125 directories only on MSDOS, not on MS-Windows.
3126
e8757f09 31272012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
3128
3129 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
3130
7604f298
EZ
31312012-10-04 Eli Zaretskii <eliz@gnu.org>
3132
3133 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
3134 see whether CreateFile failed.
3135
88d69b7d
PE
31362012-10-04 Paul Eggert <eggert@cs.ucla.edu>
3137
3138 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
3139 to avoid similar races.
3140 * keyboard.c (pending_signals): Now bool, not int.
3141
7509f454
PE
3142 Port timers to OpenBSD, plus check for timer failures.
3143 OpenBSD problem reported by Han Boetes.
3144 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
3145 and/or setitimer.
3146 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
3147 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
3148 like OpenBSD, which has timer_settime but does not declare it.
3149 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
3150 whether to use itimerspec-related primitives. All uses of
3151 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
3152
a3c5c0c5
PE
31532012-10-02 Paul Eggert <eggert@cs.ucla.edu>
3154
3155 * profiler.c (handle_profiler_signal): Fix a malloc race
3156 that caused Emacs to hang on Fedora 17 when profiling Lisp.
3157
914e743b
JD
31582012-10-02 Jan Djärv <jan.h.d@swipnet.se>
3159
3160 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
3161
d8ab37a8
EZ
31622012-10-02 Eli Zaretskii <eliz@gnu.org>
3163
3164 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
3165 consistent with the change in return value of 'safe_strsignal'.
3166
b3ecad33
PE
31672012-10-02 Paul Eggert <eggert@cs.ucla.edu>
3168
0a99eee1
PE
3169 Prefer plain 'static' to 'static inline' (Bug#12541).
3170 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
3171 (bidi_set_sor_type, bidi_push_embedding_level)
3172 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
3173 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
3174 (bidi_cache_search, bidi_cache_ensure_space)
3175 (bidi_cache_iterator_state, bidi_cache_find)
3176 (bidi_peek_at_next_level, bidi_set_paragraph_end)
3177 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
3178 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
3179 Now 'static', not 'static inline'.
3180
b3ecad33
PE
3181 Count overruns when profiling; change units to ns.
3182 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
3183 Give extra weight to samples after overruns, to attempt to count
3184 the time more accurately.
3185 (setup_cpu_timer): Change sampling interval units from ms to ns, since
3186 the underlying primitives nominally do ns.
3187 (Fprofiler_cpu_start): Document the change. Mention that
3188 the sampling intervals are only approximate.
3189
090cf9db
SM
31902012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
3191
3192 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
3193
3194 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
3195 case for the special 0 coding-system.
3196
3197 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
3198 (Fmake_overlay): Remove redundant tests.
64edc777 3199 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 3200
81550bf4
JB
32012012-10-02 Juanma Barranquero <lekktu@gmail.com>
3202
3203 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
3204 Update dependencies.
3205
aa1ba90e
PE
32062012-10-01 Paul Eggert <eggert@cs.ucla.edu>
3207
3208 Fix a malloc race condition involving strsignal.
3209 A signal can arrive in the middle of a malloc, and Emacs's signal
3210 handler can invoke strsignal, which can invoke malloc, which is
3211 not portable. This race condition bug makes Emacs hang on GNU/Linux.
3212 Fix it by altering the signal handler so that it does not invoke
3213 strsignal.
3214 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
3215 * process.c (status_message): Use const pointer, in case strsignal
3216 is #defined to safe_strsignal.
3217 * sysdep.c (sys_siglist, init_signals): Always define and
3218 initialize a substitute sys_siglist if the system does not define
3219 one, even if HAVE_STRSIGNAL.
3220 (safe_strsignal): Rename from strsignal. Always define,
3221 using sys_siglist. Return a const pointer.
3222 * syssignal.h (safe_strsignal): New decl.
3223 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
3224
ace917bd
EZ
32252012-10-01 Eli Zaretskii <eliz@gnu.org>
3226
3227 * w32proc.c (timer_loop): Fix code that waits for timer
3228 expiration, to avoid high CPU usage.
3229
9eb71b9c
SM
32302012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
3231
3232 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
3233 (sweep_weak_table): Remove redundant prototypes.
3234
b3317662
FP
32352012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
3236
3237 * emacs.c: Move the inclusion of TERM_HEADER after including
3238 windows.h on WINDOWSNT. This avoids compilation problems with
3239 MSVC.
3240
f0e5f225
EZ
32412012-10-01 Eli Zaretskii <eliz@gnu.org>
3242
2d7d1608
EZ
3243 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
3244 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
3245 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
3246 as the previous version used 'void *'.
3247
3248 * ralloc.c (ROUNDUP): Fix last change.
3249 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
3250 'size_t'.
3251
f0e5f225
EZ
3252 * w32proc.c <disable_itimers>: New static flag.
3253 (init_timers): Initialize it to zero, after creating the critical
3254 sections used by the timer threads.
3255 (term_timers): Set to 1 before deleting the critical sections.
3256 (getitimer, setitimer): If disable_itimers is non-zero, return an
3257 error indication without doing anything. Reported by Fabrice
3258 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
3259 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
3260 return results.
3261 [!HAVE_SETITIMER]: Behave as the previous version that didn't
3262 support timers.
f0e5f225
EZ
3263
3264 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
3265 term_ntproc after all the other bookkeeping, to get timers working
3266 as long as possible.
3267
82ef37c1
PE
32682012-10-01 Paul Eggert <eggert@cs.ucla.edu>
3269
b3a4c387
PE
3270 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
3271 Suggested by Juri Linkov in
3272 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
3273
b0ab8123
PE
3274 Prefer plain 'static' to 'static inline' (Bug#12541).
3275 With static functions, modern compilers inline pretty well by
3276 themselves; advice from programmers often hurts as much as it helps.
3277 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
3278 this change shrinks the text size of the Emacs executable by 1.1%
3279 without affecting CPU significantly in my benchmark.
3280 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
3281 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
3282 (mark_maybe_object, mark_maybe_pointer, bounded_number):
3283 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3284 (bset_auto_fill_function, bset_auto_save_file_format)
3285 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3286 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3287 (bset_cache_long_line_scans, bset_case_fold_search)
3288 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3289 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3290 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3291 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3292 (bset_header_line_format, bset_indicate_buffer_boundaries)
3293 (bset_indicate_empty_lines, bset_invisibility_spec)
3294 (bset_left_fringe_width, bset_major_mode, bset_mark)
3295 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3296 (bset_name, bset_overwrite_mode, bset_pt_marker)
3297 (bset_right_fringe_width, bset_save_length)
3298 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3299 (bset_scroll_up_aggressively, bset_selective_display)
3300 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3301 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
3302 (set_buffer_overlays_after):
3303 * category.c (bset_category_table):
3304 * charset.c (read_hex):
3305 * coding.c (produce_composition, produce_charset)
3306 (handle_composition_annotation, handle_charset_annotation)
3307 (char_encodable_p):
3308 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
3309 (assign_row, set_frame_matrix_frame, make_current)
3310 (add_row_entry):
3311 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
3312 * fns.c (maybe_resize_hash_table):
3313 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
3314 * gmalloc.c (register_heapinfo):
3315 * image.c (lookup_image_type):
3316 * intervals.c (set_interval_object, set_interval_left)
3317 (set_interval_right, copy_interval_parent, rotate_right)
3318 (rotate_left, balance_possible_root_interval):
3319 * keyboard.c (kset_echo_string, kset_kbd_queue)
3320 (kset_keyboard_translate_table, kset_last_prefix_arg)
3321 (kset_last_repeatable_command, kset_local_function_key_map)
3322 (kset_overriding_terminal_local_map, kset_real_last_command)
3323 (kset_system_key_syms, clear_event, set_prop):
3324 * lread.c (digit_to_number):
3325 * marker.c (attach_marker, live_buffer, set_marker_internal):
3326 * nsterm.m (ns_compute_glyph_string_overhangs):
3327 * process.c (pset_buffer, pset_command)
3328 (pset_decode_coding_system, pset_decoding_buf)
3329 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
3330 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
3331 (pset_status, pset_tty_name, pset_type, pset_write_queue):
3332 * syntax.c (bset_syntax_table, dec_bytepos):
3333 * terminal.c (tset_param_alist):
3334 * textprop.c (interval_has_some_properties)
3335 (interval_has_some_properties_list):
3336 * window.c (wset_combination_limit, wset_dedicated)
3337 (wset_display_table, wset_hchild, wset_left_fringe_width)
3338 (wset_left_margin_cols, wset_new_normal, wset_new_total)
3339 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3340 (wset_right_fringe_width, wset_right_margin_cols)
3341 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
3342 (wset_vertical_scroll_bar_type, wset_window_parameters):
3343 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3344 (wset_column_number_displayed, wset_region_showing)
3345 (window_box_edges, run_window_scroll_functions)
3346 (append_glyph_string_lists, prepend_glyph_string_lists)
3347 (append_glyph_string, set_glyph_string_background_width)
3348 (append_glyph, append_composite_glyph)
3349 (take_vertical_position_into_account):
3350 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
3351 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
3352 (lface_hash, lface_same_font_attributes_p, lookup_face):
3353 * xml.c (libxml2_loaded_p):
3354 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
3355 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
3356 Now 'static', not 'static inline'.
3357
05584c31
PE
3358 * bidi.c: Tune.
3359 (bidi_copy_it): Do the whole copy with a single memcpy.
3360 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
3361
86ec63ba
PE
3362 Revert the FOLLOW-SYMLINKS change for file-attributes.
3363 Doing it right would require several changes to Tramp, and there's
3364 not enough time to get that tested before the freeze today.
3365 * dired.c (directory_files_internal, Ffile_attributes):
3366 Undo last change.
3367
82ef37c1
PE
3368 * frame.c (x_report_frame_params): Port better to wider ints.
3369 Do not assume that EMACS_UINT is the same width as uprintmax_t,
3370 or that pointers can be printed in 15 decimal digits.
3371 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
3372
62aba0d4
FP
33732012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
3374
3375 Support x64 build on MS-Windows.
3376 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
3377 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
3378 compatibility with x64.
5e4daaf3 3379 (x_get_focus_frame): Add prototype.
62aba0d4
FP
3380
3381 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
3382 defining an XRectangle structure.
3383
3384 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
3385 arithmetics for compatibility with x64.
3386
3387 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
3388 compatibility with x64.
3389
3390 * w32heap.h: Adjust prototypes and declarations.
3391
3392 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
3393 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
3394 DWORD, long, and unsigned long, for compatibility with x64.
3395 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
3396 (sbrk): Argument is now of type ptrdiff_t.
3397
3398 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
3399 less than 0x0500.
3400 (w32_msg_pump): Use WPARAM type for 'result'.
3401
3402 * w32.c (init_environment, get_emacs_configuration): Support AMD64
3403 architecture.
3404 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
3405 compatibility with x64.
3406
3407 * vm-limit.c (lim_data): Now size_t.
3408 (check_memory_limits): Adjust prototypes of real_morecore and
3409 __morecore to receive argument of type ptrdiff_t. Use size_t for
3410 five_percent and data_size.
3411
3412 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
3413 variables, for compatibility with x64.
3414 (rva_to_section, offset_to_section, relocate_offset)
3415 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
3416 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
3417 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
3418 for compatibility with x64.
3419
3420 * sysdep.c (STDERR_FILENO): Define if not already defined.
3421
3422 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
3423 (__morecore): Argument type is now ptrdiff_t.
3424 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
3425 (relinquish): Use ptrdiff_t type for 'excess'.
3426 (r_alloc_sbrk): Argument type is now ptrdiff_t.
3427
3428 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
3429 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
3430 instead of a literal number.
3431
3432 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
3433 (min): Define only if not already defined.
3434
3435 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
3436 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
3437 hosts.
3438
3439 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
3440 'bitmaps' is a pointer.
3441
3442 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
3443
3444 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
3445
e7a2937b
PE
34462012-09-30 Paul Eggert <eggert@cs.ucla.edu>
3447
3448 file-attributes has a new optional arg FOLLOW-SYMLINKS.
3449 * dired.c (directory_files_internal, Ffile_attributes):
3450 New arg follow_symlinks. All uses changed.
3451
b43d62ae
SM
34522012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
3453
3454 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
3455
c06c382a
EZ
34562012-09-30 Eli Zaretskii <eliz@gnu.org>
3457
3458 Support atimers and CPU profiler via profile.c on MS-Windows.
3459 * w32proc.c (sig_mask, crit_sig): New static variables.
3460 (sys_signal): Support SIGALRM and SIGPROF.
3461 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 3462 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
3463 sigfillset, and sigprocmask are no longer no-ops.
3464 (sigismember): New function.
3465 (struct itimer_data): New definition.
3466 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
3467 (crit_prof): New static variables.
3468 (MAX_SINGLE_SLEEP): New definition.
3469 (timer_loop, stop_timer_thread, term_timers, init_timers)
3470 (start_timer_thread, getitimer, setitimer): New functions.
3471 (alarm): No longer a no-op, calls setitimer.
3472
3473 * w32.c (term_ntproc): Call term_timers.
3474 (init_ntproc): Make sure all signals are unblocked at startup, to
3475 erase any traces of dumping. Call init_timers.
3476
3477 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
3478 Windows-specific code to display the hourglass mouse pointer is no
3479 longer used.
3480 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
3481 to hourglass timer expiration.
3482 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
3483 Remove, no longer used.
b43d62ae
SM
3484 (w32_note_current_window, show_hourglass, hide_hourglass):
3485 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
3486 window systems.
3487 (syms_of_w32fns): Don't initialize hourglass_timer.
3488
3489 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
3490 WINDOWSNT as well.
3491 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
3492
3493 * w32.h (init_timers, term_timers): Add prototypes.
3494
95402d5f
KH
34952012-09-30 Kenichi Handa <handa@gnu.org>
3496
3497 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
3498 to the buffer relocation which may be caused by ccl_driver.
3499
dd946752
JD
35002012-09-30 Jan Djärv <jan.h.d@swipnet.se>
3501
d7e642cc
JD
3502 * xfns.c (Fx_file_dialog): Update comment.
3503
3504 * w32fns.c (Fx_file_dialog): Update comment.
3505
3506 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
3507 Initialize panel name field if OSX >= 10.6.
3508
3509 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
3510
dd946752
JD
3511 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
3512
3513 * nsterm.m (NEW_STYLE_FS): New define.
3514 (ns_fullscreen_hook, windowWillEnterFullScreen)
3515 (windowDidEnterFullScreen, windowWillExitFullScreen)
3516 (windowDidExitFullScreen, toggleFullScreen, handleFS)
3517 (setFSValue): New functions.
3518 (EmacsFSWindow): New implementation.
3519 (canBecomeKeyWindow): New function for EmacsFSWindow.
3520 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
3521 (dealloc): Release nonfs_window if in fullscreen.
3522 (updateFrameSize:): Call windowDidMove to update top/left.
3523 (windowWillResize:toSize:): Check if frame is still maximized.
3524 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
3525 next_maximized, maximized_width, maximized_height and nonfs_window.
3526 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
3527 tbar_height.
3528 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 3529 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
3530
3531 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
3532 (EmacsView): Add variables for fullscreen.
3533 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
3534 (EmacsFSWindow): New interface for fullscreen.
3535
427730eb
JB
35362012-09-30 Juanma Barranquero <lekktu@gmail.com>
3537
3538 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
3539
48de8b12
CY
35402012-09-30 Chong Yidong <cyd@gnu.org>
3541
3542 * fns.c (Frandom): Doc fix.
3543
5938d519
MR
35442012-09-30 Martin Rudalics <rudalics@gmx.at>
3545
3546 * window.c (Vwindow_combination_limit): New default value.
3547 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
3548
cb5b0266
PE
35492012-09-30 Paul Eggert <eggert@cs.ucla.edu>
3550
3551 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
3552 Suggested by Eli Zaretskii in
3553 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
3554
84f72efd
EZ
35552012-09-30 Eli Zaretskii <eliz@gnu.org>
3556
3557 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
3558 HAVE_TIMER_SETTIME is defined.
3559
9d4dcdc9
PE
35602012-09-30 Paul Eggert <eggert@cs.ucla.edu>
3561
d89460ed
PE
3562 Profiler improvements: more-accurate timers, overflow checks.
3563 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
3564 signal.h, setjmp.h. Include systime.h instead.
3565 (saturated_add): New function.
3566 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
3567 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
3568 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
3569 New static vars.
84f72efd 3570 (enum profiler_cpu_running): New enum.
d89460ed
PE
3571 (profiler_cpu_running): Now of that enum type, not bool.
3572 All uses changed to store the new value.
3573 (handle_profiler_signal): Rename from sigprof_handler_1,
3574 for consistency with other handlers. Do not check whether
3575 cpu_log is a hash-table if garbage collecting, since it
3576 doesn't matter in that case.
3577 (deliver_profiler_signal): Rename from sigprof_handler,
3578 for consistency with other handlers.
3579 (setup_cpu_timer): New function, with much of what used to be in
3580 Fprofiler_cpu_start. Check for out-of-range argument.
3581 Prefer timer_settime if available, and prefer
3582 thread cputime clocks, then process cputime clocks, then
3583 monotonic clocks, to the old realtime clock. Use make_timeval
3584 to round more-correctly when falling back to setitimer.
3585 (Fprofiler_cpu_start): Use it.
3586 (Fprofiler_cpu_stop): Prefer timer_settime if available.
3587 Don't assume that passing NULL as the 2nd argument of setitimer
3588 is the same as passing a pointer to all-zero storage.
3589 Ignore SIGPROF afterwards.
3590 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
3591 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
3592 non-fatal signal handlers. Ignore SIGPROF on startup.
3593 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
3594 in profiler.c, since sysdep.c now uses it.
3595
9d4dcdc9
PE
3596 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
3597 Suggested by Eli Zaretskii in
3598 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
3599
8e5691a0
JB
36002012-09-29 Juanma Barranquero <lekktu@gmail.com>
3601
3602 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
3603
e7c1b6ef
SM
36042012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
3605
3606 * lisp.h (struct backtrace): Remove indirection for `function' field.
3607 * xdisp.c (redisplay_internal):
3608 * profiler.c (record_backtrace, sigprof_handler_1):
3609 * alloc.c (Fgarbage_collect):
3610 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
3611 (Fbacktrace_frame): Adjust accordingly.
3612
e61d39cd 36132012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
3614
3615 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
3616 (Frun_hook_with_args_until_failure): Doc fixes.
3617
404043ea
EZ
36182012-09-28 Eli Zaretskii <eliz@gnu.org>
3619
3620 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
3621 Qautomatic_redisplay and change the symbol name. All users changed.
3622
704d3f45
TM
36232012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
3624
3625 * profiler.c (sigprof_handler): Fix race condition.
3626
757140ff
GM
36272012-09-28 Glenn Morris <rgm@gnu.org>
3628
3629 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
3630
a615a3ae
PE
36312012-09-27 Paul Eggert <eggert@cs.ucla.edu>
3632
3633 Check more robustly for timer_settime.
89d17fd0
PE
3634 * Makefile.in (LIB_TIMER_TIME): New macro.
3635 (LIBES): Add it.
a615a3ae
PE
3636 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
3637 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
3638 call timer_settime.
3639
3670daf7
TM
36402012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
3641
3642 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
3643
6a586b7f
JB
36442012-09-26 Juanma Barranquero <lekktu@gmail.com>
3645
3646 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
3647
41c8bfcf
PE
36482012-09-26 Paul Eggert <eggert@cs.ucla.edu>
3649
3650 * character.h (MAYBE_UNIFY_CHAR): Remove.
3651 * charset.c, charset.h (maybe_unify_char): Now static.
3652 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
3653 Since this stuff is now private to charset.c, there's no need for
3654 a public macro and no need to inline by hand.
3655
3a880af4
SM
36562012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
3657 Stefan Monnier <monnier@iro.umontreal.ca>
3658 Juanma Barranquero <lekktu@gmail.com>
611b7507 3659
3a880af4
SM
3660 * profiler.c: New file.
3661 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
3662 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
3663 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
3664 * emacs.c (main): Call syms_of_profiler.
3665 * alloc.c (Qautomatic_gc): New constant.
3666 (MALLOC_PROBE): New macro.
3667 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
3668 (total_bytes_of_live_objects): New function.
3669 (Fgarbage_collect): Use it. Record itself in backtrace_list.
3670 Call malloc_probe for the memory profiler.
3671 (syms_of_alloc): Define Qautomatic_gc.
3672 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
3673 race condition.
3674 (struct backtrace): Move definition...
3675 * lisp.h (struct backtrace): ..here.
3676 (Qautomatic_gc, profiler_memory_running): Declare vars.
3677 (malloc_probe, syms_of_profiler): Declare functions.
3678 * xdisp.c (Qautomatic_redisplay): New constant.
3679 (redisplay_internal): Record itself in backtrace_list.
3680 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 3681
5938d519 36822012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
36832012-09-25 Juanma Barranquero <lekktu@gmail.com>
3684
3685 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
3686
e26fd2e4
PE
36872012-09-25 Paul Eggert <eggert@cs.ucla.edu>
3688
3689 Prefer POSIX timers if available.
3690 They avoid a race if the timer is too close to the current time.
3691 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
3692 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 3693 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 3694
eedec3ee
EZ
36952012-09-25 Eli Zaretskii <eliz@gnu.org>
3696
3697 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
3698 CHAR_STRING_ADVANCE.
3699 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
3700 STRING_CHAR_ADVANCE.
3701
aa15c6bb
JB
37022012-09-25 Juanma Barranquero <lekktu@gmail.com>
3703
3704 Move Vlibrary_cache to emacs.c and reset before dumping.
3705
3706 * lisp.h (reset_image_types): Declare.
3707 [WINDOWSNT] (Vlibrary_cache): Declare.
3708
3709 * image.c (reset_image_types): New function.
3710
3711 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
3712 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
3713 (Fdump_emacs): Reset Vlibrary_cache and image_types.
3714
3715 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
3716 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
3717
3718 * w32.h (Vlibrary_cache): Do not declare.
3719
54d629be
EZ
37202012-09-25 Eli Zaretskii <eliz@gnu.org>
3721
16b22fef
EZ
3722 * w32proc.c (sys_signal): Handle all signals defined by the
3723 MS-Windows runtime, not just SIGCHLD. Actually install the signal
3724 handlers for signals supported by Windows. Don't override
3725 term_ntproc as the handler for SIGABRT.
3726 (sigaction): Rewrite to call sys_signal instead of duplicating its
3727 code.
3728 (sys_kill): Improve commentary.
3729
3730 * w32.c (term_ntproc): Accept (and ignore) one argument, for
3731 consistency with a signature of a signal handler. All callers
3732 changed.
3733 (init_ntproc): Accept an argument DUMPING. If dumping, don't
3734 install term_ntproc as a signal handler for SIGABRT, as that
3735 should be done by the dumped Emacs.
3736
3737 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
3738
3739 * w32select.c (term_w32select): Protect against repeated
3740 invocation by setting clipboard_owner to NULL after calling
3741 DestroyWindow.
3742
3743 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
3744 and term_ntproc to their modified signatures.
3745
54d629be
EZ
3746 * character.c (char_string, string_char): Remove calls to
3747 MAYBE_UNIFY_CHAR. See the discussion starting at
3748 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
3749 for the details.
3750
59f7af81
CY
37512012-09-25 Chong Yidong <cyd@gnu.org>
3752
3753 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
3754
22e8cf4a
SM
37552012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
3756
3757 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
3758 when encountering an unknown bytecode.
3759
578098f3
PE
37602012-09-24 Paul Eggert <eggert@cs.ucla.edu>
3761
3762 image.c, indent.c: Use bool for booleans.
3763 * dispextern.h (struct image_type): Members valid_p, load, init
3764 now return bool, not int. All uses changed.
3765 * image.c: Omit unnecessary static decls.
3766 (x_create_bitmap_mask, x_build_heuristic_mask):
3767 Return void, not int, since callers don't care about the return value.
3768 (x_create_bitmap_mask, define_image_type, valid_image_p)
3769 (struct image_keyword, parse_image_spec, image_spec_value)
3770 (check_image_size, image_background)
3771 (image_background_transparent, x_clear_image_1)
3772 (postprocess_image, lookup_image, x_check_image_size)
3773 (x_create_x_image_and_pixmap, xbm_image_p)
3774 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
3775 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
3776 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
3777 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
3778 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
3779 (png_image_p, init_png_functions, png_load_body, png_load)
3780 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
3781 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
3782 (init_gif_functions, gif_load, imagemagick_image_p)
3783 (imagemagick_load_image, imagemagick_load, svg_image_p)
3784 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
3785 (gs_load):
3786 * nsimage.m (ns_load_image):
3787 * nsterm.m (ns_defined_color):
3788 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
3789 * xfns.c (x_defined_color):
3790 * xterm.c (x_alloc_lighter_color_for_widget)
3791 (x_alloc_nearest_color_1, x_alloc_nearest_color)
3792 (x_alloc_lighter_color):
3793 * indent.c (disptab_matches_widthtab, current_column)
3794 (scan_for_column, string_display_width, indented_beyond_p)
3795 (compute_motion, vmotion, Fvertical_motion):
3796 Use bool for booleans.
3797
a5f2b6ec
CY
37982012-09-24 Chong Yidong <cyd@gnu.org>
3799
3800 * chartab.c (Fset_char_table_default): Obsolete function removed.
3801
18e27ea8
PE
38022012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3803
afea8a8a
PE
3804 Move pid_t related decls out of lisp.h.
3805 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
3806 (interruptible_wait_for_termination):
3807 Move these decls from lisp.h to syswait.h, since they use pid_t.
3808 Needed on FreeBSD; see Herbert J. Skuhra in
3809 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
3810 * callproc.c: Include syswait.h.
3811
18e27ea8
PE
3812 gnutls.c, gtkutil.c: Use bool for boolean.
3813 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
3814 (emacs_gnutls_handle_error):
3815 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
3816 (xg_hide_tooltip, xg_create_frame_widgets)
3817 (create_dialog, xg_uses_old_file_dialog)
3818 (xg_get_file_with_chooser, xg_get_file_with_selection)
3819 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
3820 (xg_item_label_same_p, xg_update_menubar)
3821 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
3822 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
3823 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
3824 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
3825 (update_frame_tool_bar, free_frame_tool_bar):
3826 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
3827 * nsmenu.m (ns_update_menubar):
3828 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
3829 * xfns.c (Fx_show_tip) [USE_GTK]:
3830 Use bool for boolean.
3831 * gtkutil.c (xg_update_frame_menubar):
3832 * xmenu.c (update_frame_menubar):
3833 Return void, not int, since caller ignores return value.
3834 * gtkutil.c (xg_change_toolbar_position):
3835 Return void, not 1.
3836
af0e9f75
JB
38372012-09-23 Juanma Barranquero <lekktu@gmail.com>
3838
3839 * makefile.w32-in (BLOCKINPUT_H): Remove.
3840 (SYSSIGNAL_H): New macro.
3841 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
3842 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
3843 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
3844 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
3845 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
3846 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
3847 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
3848 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
3849 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
3850 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
3851 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
3852 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
3853 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
3854 ($(BLD)/w32xfns.$(O)): Update dependencies.
3855
5101529e
EZ
38562012-09-23 Eli Zaretskii <eliz@gnu.org>
3857
3858 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
3859 fatal_error_backtrace.
3860
3861 * w32proc.c (sys_kill): Undo last change: don't do anything when
3862 invoked to deliver SIGABRT to our own process. This is now
3863 handled by emacs_raise.
3864
2c3ee0ad
JB
38652012-09-23 Juanma Barranquero <lekktu@gmail.com>
3866
3867 * w32term.c (w32_read_socket): Remove leftover reference to
3868 interrupt_input_pending.
3869
62a1d661
PE
38702012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3871
3872 Do not use SA_NODEFER.
3873 Problem reported by Dani Moncayo in
3874 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
3875 * alloc.c (die):
3876 * sysdep.c (emacs_abort): Do not reset signal handler.
3877 * emacs.c (terminate_due_to_signal): Reset signal handler here.
3878 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
3879 wanted even on POSIXish hosts, and it doesn't work on Windows.
3880
a0942b9a
JD
38812012-09-23 Jan Djärv <jan.h.d@swipnet.se>
3882
3883 * xterm.c (x_term_init): Call fixup_locale before and after calling
3884 gtk_init (Bug#12392).
3885
d07ff9db
CY
38862012-09-23 Chong Yidong <cyd@gnu.org>
3887
3888 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
3889 Vdynamic_library_alist.
3890
3891 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
3892 (Fgnutls_available_p): Caller changed.
3893
3894 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
3895 (Flibxml_parse_xml_region): Likewise.
3896
3897 * dispextern.h (struct image_type): Remove arg from init function.
3898
3899 * image.c (Finit_image_library, lookup_image_type)
3900 (define_image_type): Remove now-unneeded second arg.
3901 (init_xpm_functions, init_png_functions, init_jpeg_functions)
3902 (init_tiff_functions, init_gif_functions, init_svg_functions):
3903 Arglist and w32_delayed_load calling convention changed.
3904 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 3905 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 3906
4d7e6e51
PE
39072012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3908
3909 Simplify and avoid signal-handling races (Bug#12471).
3910 * alloc.c (die):
3911 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
3912 Avoid recursive loop if there's a fatal error in the function itself.
3913 * atimer.c (pending_atimers):
3914 * blockinput.h: Don't include "atimer.h"; no longer needed.
3915 (interrupt_input_pending): Remove. All uses removed.
3916 pending_signals now counts both atimers and ordinary interrupts.
3917 This is less racy than having three separate pending-signal flags.
3918 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
3919 (input_blocked_p):
3920 Rename from their upper-case counterparts BLOCK_INPUT,
3921 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
3922 INPUT_BLOCKED_P, and turn into functions. All uses changed.
3923 This makes it easier to access volatile variables more accurately.
3924 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
3925 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
3926 that's more reliable if the code is buggy and sets
3927 interrupt_input_blocked to a negative value. All uses changed.
3928 * atimer.c (deliver_alarm_signal):
3929 Remove. No need to deliver this to the parent; any thread can
3930 handle this signal now. All uses replaced by underlying handler.
3931 * atimer.c (turn_on_atimers):
3932 * dispnew.c (handle_window_change_signal):
3933 * emacs.c (handle_danger_signal):
3934 * keyboard.c (kbd_buffer_get_event):
3935 Don't reestablish signal handler; not needed with sigaction.
3936 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
3937 (UNBLOCK_INPUT_TO):
3938 Rework to avoid unnecessary accesses to volatile variables.
3939 (UNBLOCK_INPUT_TO): Now a function.
3940 (totally_unblock_input, unblock_input): New decls.
3941 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
3942 (init_data): Remove. Necessary stuff now done in init_signal.
3943 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
3944 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
3945 (fatal_error_code): Remove; no longer needed.
3946 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
3947 it doesn't always backtrace. All uses changed. No need to reset
3948 signal to default, since sigaction and/or die does that for us now.
3949 Use emacs_raise (FOO), not kill (getpid (), FOO).
3950 (main): Check more-accurately whether we're dumping.
3951 Move fatal-error setup to sysdep.c
3952 * floatfns.c: Do not include "syssignal.h"; no longer needed.
3953 * gtkutil.c (xg_get_file_name, xg_get_font):
3954 Remove no-longer-needed signal-mask manipulation.
3955 * keyboard.c, process.c (POLL_FOR_INPUT):
3956 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
3957 * keyboard.c (read_avail_input): Remove.
3958 All uses replaced by gobble_input.
3959 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
3960 (kbd_buffer_store_event_hold, gobble_input):
3961 (record_asynch_buffer_change) [USABLE_SIGIO]:
3962 (store_user_signal_events):
3963 No need to mess with signal mask.
3964 (gobble_input): If blocking input and there are terminals, simply
3965 set pending_signals to 1 and return. All hooks changed to not
3966 worry about whether input is blocked.
3967 (process_pending_signals): Clear pending_signals before processing
3968 them, in case a signal comes in while we're processing.
3969 By convention callers now test pending_signals before calling us.
3970 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
3971 New functions, to support changes to blockinput.h.
3972 (handle_input_available_signal): Now extern.
3973 (reinvoke_input_signal): Remove. All uses replaced by
3974 handle_async_input.
3975 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
3976 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
3977 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
3978 Clear sigmask reliably, even if Fsignal returns, which it can.
3979 Omit unnecessary accesses to volatile var.
3980 (quit_throw_to_read_char): No need to restore sigmask.
3981 * keyboard.c (gobble_input, handle_user_signal):
3982 * process.c (wait_reading_process_output):
3983 Call signal-handling code rather than killing ourselves.
3984 * lisp.h: Include <float.h>, for...
3985 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
3986 (pending_signals): Now volatile.
3987 (syms_of_data): Now const if IEEE floating point.
3988 (handle_input_available_signal) [USABLE_SIGIO]:
3989 (terminate_due_to_signal, record_child_status_change): New decls.
3990 * process.c (create_process): Avoid disaster if memory is exhausted
3991 while we're processing a vfork, by tightening the critical section
3992 around the vfork.
3993 (send_process_frame, process_sent_to, handle_pipe_signal)
3994 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
3995 ignores SIGPIPE.
3996 (send_process): No need for setjmp/longjmp any more, since the
3997 SIGPIPE stuff is now gone. Instead, report an error if errno
3998 is EPIPE.
3999 (record_child_status_change): Now extern. PID and W are now args.
4000 Return void, not bool. All callers changed.
4001 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
4002 Remove. All uses removed. This bug should be fixed now in a
4003 different way.
4004 (wait_for_termination_1): Use waitpid rather than sigsuspend,
4005 and record the child status change directly. This avoids the
4006 need to futz with the signal mask.
4007 (process_fatal_action): Move here from emacs.c.
4008 (emacs_sigaction_flags): New function, containing
4009 much of what used to be in emacs_sigaction_init.
4010 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
4011 caught by emacs, to make races less likely.
4012 (deliver_process_signal): Rename from handle_on_main_thread.
4013 All uses changed.
4014 (BACKTRACE_LIMIT_MAX): Now at top level.
4015 (thread_backtrace_buffer, threadback_backtrace_pointers):
4016 New static vars.
4017 (deliver_thread_signal, deliver_fatal_thread_signal):
4018 New functions, for more-accurate delivery of thread-specific signals.
4019 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
4020 (deliver_arith_signal): Handle in this thread, not
4021 in the main thread, since it's triggered by this thread.
4022 (maybe_fatal_sig): New function.
4023 (init_signals): New arg DUMPING so that we can be more accurate
4024 about whether we're dumping. Caller changed.
4025 Treat thread-specific signals differently from process-general signals.
4026 Block all signals while handling fatal error; that's safer.
4027 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
4028 on IEEE hosts.
4029 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
4030 Ignore SIGPIPE unless batch.
4031 (emacs_backtrace): Output backtrace for the appropriate thread,
4032 which is not necessarily the main thread.
4033 * syssignal.h: Include <stdbool.h>.
4034 (emacs_raise): New macro.
4035 * xterm.c (x_connection_signal): Remove; no longer needed
4036 now that we use sigaction.
4037 (x_connection_closed): No need to mess with sigmask now.
4038 (x_initialize): No need to reset SIGPIPE handler here, since
4039 init_signals does this for us now.
4040
8f4635e9
JD
40412012-09-23 Jan Djärv <jan.h.d@swipnet.se>
4042
4043 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 4044 background rect may be larger (Bug#12245).
8f4635e9 4045
3296976d
CY
40462012-09-23 Chong Yidong <cyd@gnu.org>
4047
4048 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
4049
d41e491e
PE
40502012-09-22 Paul Eggert <eggert@cs.ucla.edu>
4051
4052 * .gdbinit: Just stop at fatal_error_backtrace.
4053 See Stefan Monnier's request in
4054 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
4055 Remove no-longer-used query of system type.
4056
c88b867f
CY
40572012-09-22 Chong Yidong <cyd@gnu.org>
4058
4059 * search.c (Freplace_match): Doc fix (Bug#12325).
4060
4061 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
4062
4063 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
4064 (Fline_end_position): Doc fix.
4065
4066 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
4067
bb4d86b4
CY
40682012-09-22 Chong Yidong <cyd@gnu.org>
4069
4070 * dispextern.h (struct image_type): Add new slot, storing a type
4071 initialization function.
4072
4073 * image.c (define_image_type): Call the image initializer function
4074 if it is defined. Arguments and return value changed.
4075 (valid_image_p, make_image): Callers changed.
4076 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
4077 (gif_type, imagemagick_type, svg_type, gs_type):
4078 Add initialization functions.
bb4d86b4
CY
4079 (Finit_image_library): Call lookup_image_type.
4080 (CHECK_LIB_AVAILABLE): Macro deleted.
4081 (lookup_image_type): Call define_image_type here, rather than via
4082 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
4083 (syms_of_image): Move define_image_type calls for xbm_type and
4084 pbm_type to lookup_image_type.
4085
df9685f3
EZ
40862012-09-22 Eli Zaretskii <eliz@gnu.org>
4087
4088 * keyboard.c (timer_check_2): Move calculation of 'timers' and
4089 'idle_timers' from here ...
4090 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
4091 lists, to avoid infloops when the timer does something stupid,
4092 like reinvoke itself with the same or smaller time-out.
4093 (Bug#12447)
4094
8e17c9ba
MR
40952012-09-22 Martin Rudalics <rudalics@gmx.at>
4096
4097 * window.c (Fsplit_window_internal): Handle only Qt value of
4098 Vwindow_combination_limit separately.
4099 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
4100 (Vwindow_combination_limit): New default value.
4101 Rewrite doc-string.
8e17c9ba 4102
589bd69b
EZ
41032012-09-22 Eli Zaretskii <eliz@gnu.org>
4104
4105 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
4106 the new overlay string. (Bug#10159)
4107
01108e3f
PE
41082012-09-22 Paul Eggert <eggert@cs.ucla.edu>
4109
4110 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
4111 or that fprintf is async-signal-safe. POSIX doesn't require
4112 either assumption.
4113
82f8cd94
CY
41142012-09-22 Chong Yidong <cyd@gnu.org>
4115
4116 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
4117 (Bug#8207).
4118
3cccbd87
KH
41192012-09-22 Kenichi Handa <handa@gnu.org>
4120
4121 * composite.c (composition_reseat_it): Handle the case that a
4122 grapheme cluster is not covered by a single font (Bug#12352).
4123
09c01941
CY
41242012-09-21 Chong Yidong <cyd@gnu.org>
4125
4126 * image.c (define_image_type): Avoid adding duplicate types to
4127 image_types (Bug#12463). Suggested by Jörg Walter.
4128
acfa068f 41292012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
4130
4131 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
4132 (print_load_command_name): Add case LC_DATA_IN_CODE.
4133 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
4134
acfa068f 41352012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
4136
4137 * eval.c (Frun_hook_with_args_until_success)
4138 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
4139
acfa068f 41402012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
4141
4142 * fileio.c (Ffile_selinux_context): Only call freecon when
4143 lgetfilecon succeeded.
4144 (Fset_file_selinux_context): Likewise. (Bug#12444)
4145
acfa068f 41462012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
4147
4148 * xdisp.c (try_window_reusing_current_matrix): Under bidi
4149 reordering, locate the cursor by calling set_cursor_from_row; if
4150 that fails, clear the desired glyph matrix before returning a
4151 failure indication to the caller. Fixes leaving garbled display
4152 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
4153 (compute_stop_pos_backwards): Fix a typo that caused crashes while
4154 scrolling through multibyte text.
aa36e4d2 4155
e99f70c8
SM
41562012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
4157
4158 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
4159 calling mark_vectorlike since that's the one that marks the window.
4160 (mark_discard_killed_buffers): Mark the final cdr.
4161 * window.h (struct window): Move prev/next_buffers to the
4162 non-standard fields.
4163 * window.c (make_window): Initialize prev/next_buffers manually.
4164
f75beb47
PE
41652012-09-20 Paul Eggert <eggert@cs.ucla.edu>
4166
4167 Omit unused arg EXPECTED from socket hooks.
4168 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
4169 * nsterm.m (ns_term_init):
4170 * termhooks.h (struct terminal.read_socket_hook):
4171 * w32inevt.c (w32_console_read_socket):
4172 * w32term.c (w32_read_socket):
4173 * xterm.c (XTread_socket):
4174 Omit unused arg EXPECTED. All callers changed.
4175 (store_user_signal_events): Return void, not int, since callers no
4176 longer care about the return value. All uses changed.
4177
b019b76a
JB
41782012-09-20 Juanma Barranquero <lekktu@gmail.com>
4179
4180 * w32gui.h (XParseGeometry): Do not declare.
4181
05642592
PE
41822012-09-19 Paul Eggert <eggert@cs.ucla.edu>
4183
e4bce92a 4184 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 4185 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
4186 <http://bugs.gnu.org/12471#8> (last line).
4187
05642592
PE
4188 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
4189 (XParseGeometry): Now static. Substitute extremal values for
4190 values that are out of range.
4191
e543ae91
JD
41922012-09-19 Jan Djärv <jan.h.d@swipnet.se>
4193
4194 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
4195
4196 * nsfns.m (XParseGeometry): Remove.
4197 (Fx_create_frame): Call x_set_offset to correctly interpret
4198 top_pos in geometry.
4199
3a880af4 4200 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
4201 (Fx_parse_geometry): If there is a space in string, call
4202 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
4203
45ba16c7
EZ
42042012-09-17 Eli Zaretskii <eliz@gnu.org>
4205
c8b9f1bc
EZ
4206 * search.c (scan_buffer): Use character positions in calls to
4207 region_cache_forward and region_cache_backward, not byte
4208 positions. (Bug#12196)
4209
b4c932a2
EZ
4210 * w32term.c (w32_read_socket): Set pending_signals to 1, like
4211 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
4212
45ba16c7
EZ
4213 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
4214 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
4215 emacs_blocked_malloc, now deleted.
4216
eeceac93
PE
42172012-09-17 Paul Eggert <eggert@cs.ucla.edu>
4218
4219 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
4220 The workaround was for improving performance on Solaris 2.4, but
4221 is getting in the way now. Emacs will still work if someone is
4222 still running Solaris 2.4 in a museum somewhere; Sun dropped
4223 support for Solaris 2.4 in 2003.
4224 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
4225 * process.c (create_process) [HAVE_WORKING_VFORK]:
4226 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
4227 since Emacs no longer uses vfork on that platform.
4228
78f83752
GM
42292012-09-17 Glenn Morris <rgm@gnu.org>
4230
4231 * emacs.c: Use COPYRIGHT.
4232
634b8cac
PE
42332012-09-16 Paul Eggert <eggert@cs.ucla.edu>
4234
0caaedb1
PE
4235 Remove configure's --without-sync-input option (Bug#12450).
4236 When auditing signal-handling in preparation for cleaning it up,
4237 I found that SYNC_INPUT has race conditions and would be a real
4238 pain to fix. Since it's an undocumented and deprecated
4239 configure-time option, now seems like a good time to remove it.
4240 Also see <http://bugs.gnu.org/11080#16>.
4241 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
4242 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
4243 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
4244 (malloc_hysteresis):
4245 (check_depth) [XMALLOC_OVERRUN_CHECK]:
4246 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
4247 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
4248 (dont_register_blocks, bytes_used_when_reconsidered)
4249 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
4250 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
4251 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 4252 Remove. All uses removed.
0caaedb1
PE
4253 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
4254 implementation, one that depends on whether the new macro
4255 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
4256 is defined.
4257 * atimer.c (run_timers, handle_alarm_signal):
4258 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
4259 (handle_async_input, process_pending_signals)
4260 (handle_input_available_signal, init_keyboard):
4261 * nsterm.m (ns_read_socket):
4262 * process.c (wait_reading_process_output):
4263 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
4264 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
4265 (emacs_write):
4266 * xterm.c (XTread_socket):
4267 Assume SYNC_INPUT.
4268 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
4269 * eval.c (handling_signal): Remove. All uses removed.
4270 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
4271 All uses replaced with the SYNC_INPUT version.
4272 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
4273 Remove decls.
4274 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4275 Now static.
4276
634b8cac
PE
4277 * font.c (Ffont_shape_gstring): Remove unused local.
4278
83da1b55
GM
42792012-09-16 Glenn Morris <rgm@gnu.org>
4280
518650a5
GM
4281 * Makefile.in (clean): No longer run nextstep's clean.
4282
83da1b55
GM
4283 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
4284 (ns_frag): Remove.
4285 (ns-app): Move here from ns.mk, and simplify.
4286 (clean): Simplify nextstep entry.
4287 * ns.mk: Remove file.
4288
85a43e2e
KH
42892012-09-17 Kenichi Handa <handa@gnu.org>
4290
4291 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
4292 not covert the last few charactes.
4293
ba13e616 42942012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
4295
4296 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
4297 here, but just check the validity of glyphs in the glyph-string.
4298
a8c729af
MR
42992012-09-16 Martin Rudalics <rudalics@gmx.at>
4300
3a880af4
SM
4301 * window.c (Fwindow_parameter, Fset_window_parameter):
4302 Accept any window as argument (Bug#12452).
a8c729af 4303
c077c059
JD
43042012-09-16 Jan Djärv <jan.h.d@swipnet.se>
4305
4306 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
4307 to ns_term_init to avoid memory leak.
4308
4309 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
4310 explicit retain/release.
4311 (ns_term_init): Only allow one display. Initialize outerpool and
4312 ns_*_types.
4313
39a57ad0
PE
43142012-09-15 Paul Eggert <eggert@cs.ucla.edu>
4315
4316 Port _setjmp fix to POSIXish hosts as well as Microsoft.
4317 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
4318 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
4319 the Microsoft problem in a different way, by altering ../nt/config.nt.
4320
7105c8cb
EZ
43212012-09-15 Eli Zaretskii <eliz@gnu.org>
4322
4323 * w32xfns.c:
4324 * w32uniscribe.c:
4325 * w32term.c:
4326 * w32select.c:
4327 * w32reg.c:
4328 * w32proc.c:
4329 * w32menu.c:
4330 * w32inevt.c:
4331 * w32heap.c:
4332 * w32font.c:
4333 * w32fns.c:
4334 * w32console.c:
4335 * w32.c:
4336 * w16select.c: Remove inclusion of setjmp.h, as it is now included
4337 by lisp.h. This completes removal of setjmp.h inclusion
4338 erroneously announced in the previous commit. (Bug#12446)
4339
4340 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
4341 more accurate.
4342
4343 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
4344 not defined as a macro. The latter happens on MS-Windows.
4345 (Bug#12446)
4346
0328b6de
PE
43472012-09-15 Paul Eggert <eggert@cs.ucla.edu>
4348
4349 Port better to POSIX hosts lacking _setjmp (Bug#12446).
4350 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 4351 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
4352 only reason for the instance was because "lisp.h" was included.
4353 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
4354 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
4355 and _longjmp with the new symbols. Emacs already uses _setjmp if
4356 available, so this change affects only POSIXish hosts that have
4357 sigsetjmp but not _setjmp, such as some versions of Solaris and
4358 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
4359 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
4360 (png_load_body) [HAVE_PNG]:
4361 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
4362 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
4363 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
4364 since PNG requires jmp_buf. This is the only exception to the
4365 general rule that we now use sys_setjmp and sys_longjmp.
4366 This exception is OK since this code does not change the signal
4367 mask or longjmp out of a signal handler.
4368
2af03429
PE
43692012-09-14 Paul Eggert <eggert@cs.ucla.edu>
4370
4371 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
4372 Include "syssignal.h", for 'main_thread'.
4373
2f294edf
DA
43742012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
4375
4376 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
4377 * insdel.c (replace_range, replace_range_2):
4378 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
4379 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
4380 Remove redundant check before calling offset_intervals.
4381
6b533e9c
MR
43822012-09-14 Martin Rudalics <rudalics@gmx.at>
4383
4384 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
4385 current buffer (Bug#12387).
4386
2a7931e3
JB
43872012-09-14 Juanma Barranquero <lekktu@gmail.com>
4388
4389 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
4390
c18e885b
PE
43912012-09-13 Paul Eggert <eggert@cs.ucla.edu>
4392
4393 Use a more backwards-compatible timer format (Bug#12430).
4394 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
4395 vector element, not from the 4th, since PSECS is now at the end.
4396 (Fcurrent_idle_time): Doc fix.
4397
d59a1afb
DA
43982012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
4399
4400 Function to mark objects and remove killed buffers at once.
4401 * alloc.c (discard_killed_buffers): Rename to ...
4402 (mark_discard_killed buffers) ... new name. Add marking
4403 of remaining objects. Fix comment. Adjust users.
4404 (mark_object): Do not touch frame buffer lists here.
4405 * frame.c (delete_frame): Reset frame buffer lists here.
4406
5f0cb45a
PE
44072012-09-13 Paul Eggert <eggert@cs.ucla.edu>
4408
8ea47e3a
PE
4409 Better workaround for GNOME bug when --enable-gcc-warnings.
4410 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
4411 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
4412 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
4413
4a4bbad2
PE
4414 Simplify SIGIO usage (Bug#12408).
4415 The code that dealt with SIGIO was crufty and confusing, e.g., it
4416 played tricks like "#undef SIGIO" but these tricks were not used
4417 consistently. Simplify mostly by not #undeffing standard symbols,
4418 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
4419 or not as we please) rather than "defined SIGIO" (standard symbol
4420 that we probably shouldn't #undef).
4421 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
4422 Modules that need it can include it.
4423 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
4424 * dispextern.h (ignore_sigio): New decl.
4425 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
4426 unconditionally, since it's now a no-op if !USABLE_SIGIO.
4427 * emacs.c (shut_down_emacs):
4428 * keyboard.c (kbd_buffer_store_event_hold):
4429 Use ignore_sigio rather than invoking 'signal' directly.
4430 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
4431 for FIONREAD.
4432 (FIONREAD, SIGIO): Do not #undef.
4433 (tty_read_avail_input): Use #error rather than a syntax error.
4434 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
4435 for I_PIPE, used by SETUP_SLAVE_PTY.
4436 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
4437 * sysdep.c (croak): Remove; no longer needed. This bit of
4438 temporary code, with Fred N. Fish's comment that it's temporary,
4439 has been in Emacs since at least 1992!
4440 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
4441 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
4442 * syssignal.h (croak): Remove decl.
4443 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
4444 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
4445 now that we're termios-only.
4446 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
4447 * term.c (dissociate_if_controlling_tty): Use #error rather than
4448 a run-time error.
4449
5f0cb45a
PE
4450 Work around GCC and GNOME bugs when --enable-gcc-warnings.
4451 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
4452 to work around GNOME bug 683906.
4453 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
4454 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
4455 This works around GCC bug 54561.
4456
40bce90b
PE
44572012-09-12 Paul Eggert <eggert@cs.ucla.edu>
4458
4459 More fixes for 'volatile' and setjmp/longjmp.
4460 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
4461 * image.c (struct png_load_context) [HAVE_PNG]: New type.
4462 (png_load_body) [HAVE_PNG]:
4463 (jpeg_load_body) [HAVE_JPEG]:
4464 New function, with most of the old parent function's body.
4465 (png_load) [HAVE_PNG]:
4466 (jpeg_load) [HAVE_JPEG]:
4467 Invoke the new function, to avoid longjmp munging our locals.
4468 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
4469 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
4470 longjmp is passed 2, as the C standard doesn't guarantee this.
4471 Instead, store the failure code into mgr->failure_code.
4472
bfeae2cf
SM
44732012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
4474
4475 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
4476 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
4477 (syms_of_keyboard): Remove support for unread-command-char.
4478
8099e36b
EZ
44792012-09-12 Eli Zaretskii <eliz@gnu.org>
4480
4481 * w32proc.c (sys_kill): If PID is our process ID and the signal is
4482 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
4483 violation. (Bug#12426)
4484
92547ff9
PE
44852012-09-12 Paul Eggert <eggert@cs.ucla.edu>
4486
4487 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
4488
45b82ad0
SM
44892012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
4490
4491 * eval.c: Add `inhibit-debugger'.
4492 (Qinhibit_debugger): New symbol.
4493 (call_debugger): Bind it instead of Qdebug_on_error.
4494 (maybe_call_debugger): Test Vinhibit_debugger.
4495 (syms_of_eval): Define inhibit-debugger.
4496 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
4497 (syms_of_xdisp): Remove inhibit-debug-on-message.
4498
5779a1dc
PE
44992012-09-11 Paul Eggert <eggert@cs.ucla.edu>
4500
50f2e553
PE
4501 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
4502 If a nonvolatile local variable is written before a _longjmp to
4503 the frame containing the variable, and is read after the _longjmp,
4504 the value read is indeterminate. Some local variables of type
4505 'struct handler' and 'struct catchtag' are used in this way, so
4506 mark each of their slots as volatile if the slot can be set before
4507 _longjmp and read afterwards.
4508 * lisp.h (struct handler): var and chosen_clause are now volatile.
4509 (struct catchtag): val, next, and pdlcount are now volatile.
4510
ae1d87e2
PE
4511 * bidi.c (bidi_push_it, bidi_pop_it):
4512 * fns.c (copy_hash_table):
4513 * image.c (define_image_type):
4514 * keyboard.c (kbd_buffer_store_event_hold):
4515 * process.c (Fprocess_send_eof):
4516 * xfaces.c (x_create_gc) [HAVE_NS]:
4517 * xgselect.c (xg_select):
4518 Prefer assignment to memcpy when either will do.
4519
5779a1dc
PE
4520 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
4521 Use pointer-to-a-pointer to simplify and avoid a NILP check each
4522 time an item is removed. No need to mark this function 'inline';
4523 the compiler knows better than we do.
4524
c4c9756b
JD
45252012-09-11 Jan Djärv <jan.h.d@swipnet.se>
4526
4527 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
4528 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
4529 to change_frame_size (Bug#12388).
4530 (windowDidResize:): Pass YES to updateFrameSize.
4531
4532 * nsterm.h: Add delay parameter to updateFrameSize.
4533
d73e321c
DA
45342012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
4535
4536 Discard killed buffers from deleted window and frame objects.
4537 This reduces an amount of references to killed buffers and
4538 helps GC to reclaim them faster.
4539 * alloc.c (discard_killed_buffers): New function.
4540 (mark_object): Use it for deleted windows and frames.
4541 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 4542 or deleted frame, restore its global binding.
d73e321c
DA
4543 * data.c (swap_in_global_binding): Add GC notice.
4544 (swap_in_symval_forwarding): Use convenient set_blv_where.
4545 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
4546 * window.h: ... to here.
4547
e578f381
DA
45482012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
4549
4550 Convenient macro to check whether the buffer is live.
4551 * buffer.h (BUFFER_LIVE_P): New macro.
4552 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
4553 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
4554
3057e615
YM
45552012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4556
4557 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
4558 composition cases (Bug#12364).
4559
4560 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
4561 overhang of succeeding glyphs overlapping box cursor.
4562
4563 * w32term.c (x_draw_glyph_string): Likewise.
4564
6fda35f2
PE
45652012-09-11 Paul Eggert <eggert@cs.ucla.edu>
4566
c990426a
PE
4567 Simplify, document, and port floating-point (Bug#12381).
4568 The porting part of this patch fixes bugs on non-IEEE platforms
4569 with frexp, ldexp, logb.
4570 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
4571 Now static.
4572 * floatfns.c: Simplify discussion of functions that Emacs doesn't
4573 support, by removing commented-out code and briefly listing the
4574 C89 functions excluded. The commented-out stuff was confusing
4575 maintenance, e.g., we thought we needed cbrt but it was commented out.
4576 (logb): Remove decl; no longer needed.
4577 (isfinite): New macro, if not already supplied.
4578 (isnan): Don't replace any existing macro.
4579 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
4580 are present on all C89 platforms.
4581 (Ffrexp): Do not special-case zero, as frexp does the right thing
4582 for that case.
4583 (Flogb): Do not use logb, as it doesn't have the desired meaning
4584 on hosts that use non-base-2 floating point. Instead, stick with
4585 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
4586 frexp, to avoid getting an unspecified result.
4587
6fda35f2
PE
4588 * xdisp.c (Qinhibit_debug_on_message): Now static.
4589
16130a58
JD
45902012-09-10 Jan Djärv <jan.h.d@swipnet.se>
4591
4592 * nsterm.m (ns_update_begin): Set clip path to whole view by using
4593 NSBezierPath (Bug#12131).
4594
d105a573
CY
45952012-09-10 Chong Yidong <cyd@gnu.org>
4596
4597 * fns.c (Fdelq, Fdelete): Doc fix.
4598
ff55dfe8
PE
45992012-09-10 Paul Eggert <eggert@cs.ucla.edu>
4600
4601 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
4602 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
4603
e7032e7c
SM
46042012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
4605
4606 * lisp.h (make_lisp_ptr): New macro to replace XSET.
4607 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
4608 Use it.
4609
e9957956
EZ
46102012-09-09 Eli Zaretskii <eliz@gnu.org>
4611
aba05ce9
EZ
4612 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
4613 left fringe if the window has a left margin. This avoids leaving
4614 traces of the cursor because its leftmost pixel is not drawn over.
4615
e9957956
EZ
4616 * dispnew.c (update_window_line): When the left margin area of a
4617 screen line is updated, set the redraw_fringe_bitmaps_p flag of
4618 that screen line. (Bug#12277)
4619
f6196b87
PE
46202012-09-09 Paul Eggert <eggert@cs.ucla.edu>
4621
4622 Assume C89 or later for math functions (Bug#12381).
4623 This simplifies the code, and makes it a bit smaller and faster,
4624 and (most important) makes it easier to clean up signal handling
4625 since we can stop worring about floating-point exceptions in
4626 library code. That was a problem before C89, but the problem
4627 went away many years ago on all practical Emacs targets.
4628 * data.c, image.c, lread.c, print.c:
4629 Don't include <math.h>; no longer needed.
4630 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
4631 might be autoconfigured, as that never happens.
4632 * data.c (fmod):
4633 * doprnt.c (DBL_MAX_10_EXP):
4634 * print.c (DBL_DIG):
4635 Remove. C89 or later always defines these.
4636 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
4637 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
4638 (arith_error, domain_error, domain_error2):
4639 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
4640 no longer needed -- we simply return what C returns. All uses removed.
4641 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
4642 the wrapped code.
4643 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
4644 Remove. All uses expanded, as these macros are no longer used
4645 more than once and are now more trouble than they're worth.
4646 (Ftan): Use tan, not sin / cos.
4647 (Flogb): Assume C89 frexp.
4648 (fmod_float): Assume C89 fmod.
4649 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
4650 (init_floatfns): Remove. All uses removed.
4651
9d7f1863
JD
46522012-09-08 Jan Djärv <jan.h.d@swipnet.se>
4653
4654 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
4655 compositeToPoint for OSX < 10.6 (Bug#12390).
4656
eabf0404
PE
46572012-09-08 Paul Eggert <eggert@cs.ucla.edu>
4658
4659 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
4660 This produces more-accurate results.
4661
0b3b1d23
JD
46622012-09-08 Jan Djärv <jan.h.d@swipnet.se>
4663
4664 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
4665 changes (Bug#12088).
4666
6dcef6ec
CY
46672012-09-08 Chong Yidong <cyd@gnu.org>
4668
4669 * syntax.c (Fstring_to_syntax): Doc fix.
4670
aa7d57c5
JD
46712012-09-08 Jan Djärv <jan.h.d@swipnet.se>
4672
4673 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
4674 in the internal border.
4675 (x_set_window_size): Remove static variables and their usage.
4676 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
4677 (ns_after_update_window_line, ns_draw_fringe_bitmap):
4678 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
4679 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
4680 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
4681 (ns_fix_rect_ibw): Remove.
4682 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
4683 (ns_dumpglyphs_box_or_relief): Ditto.
4684 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
4685 adjustment.
4686 (ns_dumpglyphs_image): Ditto.
fc0c31f8 4687 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
4688 border adjustment.
4689 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
4690 their usage. Add fringe_extended_p and its use as in other terms.
4691 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
4692 scroll bar was removed.
4693 (updateFrameSize): New function.
4694 (windowDidResize): Move code to updateFrameSize and call it.
4695
4696 * nsterm.h (EmacsView): Add updateFrameSize.
4697
1a5432bc
CY
46982012-09-07 Chong Yidong <cyd@gnu.org>
4699
b4f5313e
CY
4700 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
4701
1a5432bc
CY
4702 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
4703
1a4f1e9b
PE
47042012-09-07 Paul Eggert <eggert@cs.ucla.edu>
4705
4706 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
4707 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
4708 Problem introduced when merging patches. Noted by Eli Zaretskii in
4709 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
4710 * floatfns.c: Comment fix.
4711 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
4712 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
4713 and anyway the declaration is harmless even if SIGDANGER is not defined.
4714 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
4715 defined BROKEN_FIONREAD). systty.h formerly did this, but other
4716 source files not surprisingly expected syssignal.h to define, or
4717 not define, SIGIO, and it's cleaner to do it that way, for consistency.
4718 Include <sys/ioctl.h>, for FIONREAD.
4719 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
4720 This eliminates a problem whereby other files mysteriously had
4721 to include "syssignal.h" before including "systty.h" if they
4722 wanted to use "#ifdef SIGIO".
4723
bc8000ff
EZ
47242012-09-07 Eli Zaretskii <eliz@gnu.org>
4725
3e6d6928
EZ
4726 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
4727
4728 * w32.c (sigemptyset): Empty the set.
4729 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
4730
bc8000ff
EZ
4731 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
4732
b4fa72f2
DA
47332012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
4734
4735 * alloc.c (mark_buffer): Revert unsafe marking optimization.
4736 (mark_object): Likewise for frame objects.
4737
30730c93
PE
47382012-09-07 Paul Eggert <eggert@cs.ucla.edu>
4739
4740 * syssignal.h (handle_on_main_thread): Always declare,
4741 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
4742 This ports to platforms without HAVE_PTHREAD.
4743
2fe28299
PE
47442012-09-06 Paul Eggert <eggert@cs.ucla.edu>
4745
4746 Signal-handler cleanup (Bug#12327).
4747 Emacs's signal handlers were written in the old 4.2BSD style with
4748 sigblock and sigmask and so forth, and this led to some
4749 inefficiencies and confusion. Rewrite these to use
4750 pthread_sigmask etc. without copying signal sets around. Also,
4751 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
4752 'signal', and instead use functions that do not attempt to take
4753 over the system name space. This patch causes Emacs's text
4754 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
4755 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
4756 Do not include <signal.h> or "syssignal.h", as these
4757 modules do not use signals.
4758 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
4759 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
4760 Do not include <signal.h>, as "syssignal.h" does that for us now.
4761 * atimer.c (sigmask_atimers): New function.
4762 (block_atimers, unblock_atimers): New functions,
4763 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
4764 All uses replaced.
4765 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
4766 no longer needed here.
4767 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 4768 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
4769 * sysdep.c (struct save_signal): New member 'action', replacing
4770 old member 'handler'.
4771 (save_signal_handlers, restore_signal_handlers):
4772 Use sigaction instead of 'signal' to save and restore.
4773 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
4774 New function. All users of 'signal' modified to use set_sighandler
4775 if they're writeonly, and to use sys_signal if they're read+write.
4776 (emacs_sigaction_init, forwarded_signal): New functions.
4777 (sys_signal): Remove. All uses replaced by calls to sigaction
4778 and emacs_sigaction_init, or by direct calls to 'signal'.
4779 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
4780 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
4781 all uses replaced by pthread_sigmask etc. calls.
4782 * syssignal.h: Include <signal.h>.
4783 (emacs_sigaction_init, forwarded_signal): New decls.
4784 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
4785 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
4786 (sigmask, sys_sigmask): Remove; no longer needed.
4787 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
4788 (sigblock, sigunblock, sigfree):
4789 (sigsetmask) [!defined sigsetmask]:
4790 Remove. All uses replaced by pthread_sigmask.
4791 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
4792 no longer need to be replaced, and its typical old uses
4793 are now done via emacs_sigaction_init and sigaction.
4794 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
4795 (sys_sigdel): Remove; unused.
4796 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
4797
0216c128
EZ
47982012-09-06 Eli Zaretskii <eliz@gnu.org>
4799
4800 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
4801 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
4802
c752cfa9
DA
48032012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
4804
4805 Explicitly mark buffer_defaults and buffer_local_symbols.
4806 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
4807 mark_local_symbols here.
4808 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
4809 since special buffers aren't marked here any more.
4810 (allocate_buffer): Chain new buffer with all_buffers here...
4811 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
4812 not here.
4813 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
4814 (syms_of_buffer): Remove staticpro of the above.
4815 (init_buffer_once): Set names for buffer_defaults and
4816 buffer_local_symbols.
4817
a864ef14
PE
48182012-09-06 Paul Eggert <eggert@cs.ucla.edu>
4819
4820 Use bool for booleans in font-related modules.
4821 * font.c (font_intern_prop, font_style_to_value)
4822 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
4823 (generate_otf_features, font_check_otf_features, font_check_otf)
4824 (font_match_p, font_list_entities, font_at):
4825 * fontset.c (fontset_id_valid_p, reorder_font_vector
4826 (fontset_find_font, Fset_fontset_font)
4827 (face_suitable_for_char_p) [0]:
4828 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
4829 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
4830 (m17n_flt_initialized, ftfont_shape_by_flt):
4831 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
4832 * nsfont.m (nsfont_draw):
4833 * w32font.c (w32font_draw):
4834 * w32term.c (x_draw_glyphless_glyph_string_foreground):
4835 Use bool for booleans.
4836 * font.h: Adjust to above API changes.
4837 (struct font, struct font_driver, struct font_driver_list):
4838 Use bool for booleans.
4839 (struct font): Remove useless member encoding_type.
4840 All users removed.
4841 * fontset.c, xftfont.c: Omit unnecessary static decls.
4842
0699fc18
DA
48432012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
4844
4845 * alloc.c (mark_object): Revert window marking code
4846 since it's unsafe for the Fset_window_configuration.
4847
20ef56db
PE
48482012-09-05 Paul Eggert <eggert@cs.ucla.edu>
4849
2fe28299 4850 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
4851 Be more systematic about preserving errno whenever a signal
4852 handler returns, even if it's not in the main thread. Do this by
4853 renaming signal handlers to distinguish between signal delivery
4854 and signal handling. All uses changed.
4855 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
4856 * data.c (deliver_arith_signal): Rename from arith_error.
4857 * dispnew.c (deliver_window_change_signal): Rename from
4858 window_change_signal.
4859 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
4860 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
4861 * keyboard.c (deliver_input_available_signal): Rename from
4862 input_available_signal.
4863 (deliver_user_signal): Rename from handle_user_signal.
4864 (deliver_interrupt_signal): Rename from interrupt_signal.
4865 * process.c (deliver_pipe_signal): Rename from send_process_trap.
4866 (deliver_child_signal): Rename from sigchld_handler.
4867 * atimer.c (handle_alarm_signal):
4868 * data.c (handle_arith_signal):
4869 * dispnew.c (handle_window_change_signal):
4870 * emacs.c (handle_fatal_signal, handle_danger_signal):
4871 * keyboard.c (handle_input_available_signal):
4872 * keyboard.c (handle_user_signal, handle_interrupt_signal):
4873 * process.c (handle_pipe_signal, handle_child_signal):
4874 New functions, with the actual signal-handling code taken from the
4875 original respective signal handlers, sans the sporadic attempts to
4876 preserve errno, since that's now done by handle_on_main_thread.
4877 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
4878 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
4879 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4880 Move to sysdep.c.
4881 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4882 Move initialization of main_thread to sysdep.c's init_signals.
4883 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
4884 our usage, and simplifies the mainline code.
4885 (record_child_status_change): New static function, as a helper
4886 for handle_child_signal, and with most of the old child handler's
4887 contents.
4888 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
4889 (handle_child_signal): Use the above.
4890 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4891 Moved here from emacs.c.
4892 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
4893 code moved here from emacs.c's main function.
4894 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
4895 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
4896 This lets callers save and restore errno properly.
20ef56db 4897
e3ccf108
DA
48982012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4899
4900 Remove redundant or unused things here and there.
4901 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
4902 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
4903 * editfns.c (Fcompare_buffer_substrings): Likewise.
4904 * frame.h (struct terminal, struct font_driver_list):
4905 Remove redundant declarations.
4906 * window.h (Qleft, Qright): Likewise.
4907
697e1e39
DA
49082012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4909
4910 Do not mark objects from deleted buffers, windows and frames.
4911 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
4912 (mark_object): Likewise for windows and frames.
4913
c1ca42ca
DA
49142012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4915
4916 * alloc.c (valid_lisp_object_p): Treat killed buffers,
4917 buffer_defaults and buffer_local_symbols as valid objects.
4918 Return special value to denote them.
4919
014d93be
PE
49202012-09-05 Paul Eggert <eggert@cs.ucla.edu>
4921
f75d7a91
PE
4922 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
4923 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
4924 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
4925 (file_name_absolute_p, Fsubstitute_in_file_name):
4926 (check_executable, check_writable, Ffile_accessible_directory_p)
4927 (Fset_file_selinux_context, Fdefault_file_modes)
4928 (Finsert_file_contents, choose_write_coding_system)
4929 (Fwrite_region, build_annotations, a_write, e_write)
4930 (Fdo_auto_save):
4931 * filelock.c (boot_time_initialized, get_boot_time)
4932 (get_boot_time_1, lock_file_1, within_one_second):
4933 * floatfns.c (in_float):
4934 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
4935 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
4936 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
4937 * lisp.h (struct Lisp_Hash_Table.cmpfn):
4938 * window.c (compare_window_configurations):
4939 Use bool for booleans.
4940 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
4941 (Fdefault_file_modes): Now mode_t, not int, for modes.
4942 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
4943 (internal_delete_file): Now returns void, not a (boolean) int,
4944 since nobody was looking at the return value.
4945 * lisp.h, window.h: Adjust to above API changes.
4946
014d93be
PE
4947 * xdisp.c (set_message): Simplify and reindent last change.
4948
776f29e1
JB
49492012-09-05 Juanma Barranquero <lekktu@gmail.com>
4950
4951 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
4952
7f7e0167
LI
49532012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
4954
4955 * eval.c (call_debugger): Make the function non-static so that we
4956 can call it from set_message.
4957
4958 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
4959 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
4960
cf29dd84
PE
49612012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4962
4963 Give more-useful info on a fatal error (Bug#12328).
4964 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
4965 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
4966 of doing the work ourselves.
4967 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
4968 do most of the work.
4969 (fatal_error_backtrace): New function, taken from the guts
4970 of the old fatal_error_signal, but with a new option to output
4971 a backtrace.
4972 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
4973 info about the signal than just its number.
4974 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
4975 * sysdep.c: Include <execinfo.h>
4976 (emacs_backtrace): New function, taken partly from the previous
4977 code of the 'die' function.
4978 (emacs_abort): Call fatal_error_backtrace rather than abort.
4979
972debf2
SM
49802012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
4981
4982 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
4983 eager (load-time) macro-expansion.
4984 * lisp.mk (lisp): Add macroexp.
4985
1088b922
PE
49862012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4987
4988 Simplify redefinition of 'abort' (Bug#12316).
4989 Do not try to redefine the 'abort' function. Instead, redo
4990 the code so that it calls 'emacs_abort' rather than 'abort'.
4991 This removes the need for the NO_ABORT configure-time macro
4992 and makes it easier to change the abort code to do a backtrace.
4993 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
4994 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
4995 Remove; sysdep.c's emacs_abort now takes its place.
4996 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
4997 'abort' changed to use 'emacs_abort'.
4998 * msdos.c (dos_abort) [defined abort]: Remove; not used.
4999 (abort) [!defined abort]: Rename to ...
5000 (emacs_abort): ... new name.
5001 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
5002 the place of the old 'abort' in emacs.c.
5003 * w32.c, w32fns.c (abort): Do not #undef.
5004 * w32.c (emacs_abort): Rename from w32_abort.
5005
30934d33
EZ
50062012-09-04 Eli Zaretskii <eliz@gnu.org>
5007
5008 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
5009 offsets[j].dv, since the y axis of the screen coordinates points
5010 down, while the y axis of the font definition coordinates points
5011 up. This fixes display of Arabic diacritics such as KASRA and
5012 KASRATAN. (Bug#11860)
5013
af26b72c
PE
50142012-09-04 Paul Eggert <eggert@cs.ucla.edu>
5015
5016 Be more systematic about _setjmp vs setjmp.
5017 * alloc.c (test_setjmp, mark_stack):
5018 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
5019 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
5020 (png_load, my_error_exit, jpeg_load):
5021 * process.c (send_process_trap, send_process):
5022 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
5023 The underscored versions are up to 30x faster on some hosts.
5024 Formerly, the code used setjmp+longjmp sometimes and
5025 _setjmp+_longjmp at other times, with no particular reason to
5026 prefer setjmp+longjmp.
5027
26d4541d
PE
50282012-09-03 Paul Eggert <eggert@cs.ucla.edu>
5029
d42f4f0f 5030 Fix minor problem found by static checking.
26d4541d 5031 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 5032
c5e28e39
MR
50332012-09-03 Martin Rudalics <rudalics@gmx.at>
5034
5035 * buffer.c (Fdelete_all_overlays): New function.
5036
3eab3ca9
CY
50372012-09-03 Chong Yidong <cyd@gnu.org>
5038
5039 * gtkutil.c: Add extern decl for Qxft.
5040
c04889f8
PE
50412012-09-02 Paul Eggert <eggert@cs.ucla.edu>
5042
1882aa38
PE
5043 * emacs.c, eval.c: Use bool for boolean.
5044 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
5045 (malloc_using_checking) [DOUG_LEA_MALLOC]:
5046 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
5047 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
5048 (main, decode_env_path, Fdaemon_initialized):
5049 * eval.c (call_debugger, Finteractive_p, interactive_p):
5050 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
5051 (maybe_call_debugger, Fbacktrace):
5052 * process.c (read_process_output, exec_sentinel):
5053 Use bool for booleans.
5054 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
5055 All callers changed.
5056 * eval.c (interactive_p): Omit always-true boolean argument
5057 EXCLUDE_SUBRS_P. All callers changed.
5058 * dispextern.h, lisp.h: Reflect above API changes.
5059 * firstfile.c (dummy): Use the address of 'main', whose signature
5060 won't change, instead of the address of 'initialize', whose
5061 signature just changed from int to bool.
5062 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
5063 * msdos.c (fatal_error_in_progress): ... from here.
5064 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
5065 of incrementing it.
5066 (redisplay_internal, unwind_redisplay): Simply clear
5067 REDISPLAYING_P when unwinding, instead of saving its previous,
5068 always-false value and then restoring it.
5069
a411ac43
PE
5070 Clean up some extern decls.
5071 Mostly, this hoists extern decls out of .c files and into .h files.
5072 That way, we're more likely to catch errors if the interfaces change.
5073 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
5074 declare xg_mark_data.
5075 * dispextern.h (x_frame_parm_handlers):
5076 * font.h (Qxft):
5077 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
5078 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
5079 (Qultra_bold, Qoblique, Qitalic):
5080 Move extern decl here from .c file.
5081 * alloc.c (xg_mark_data) [USE_GTK]:
5082 * doc.c (Qclosure):
5083 * eval.c (Qlexical_binding):
5084 * fns.c (time) [!HAVE_UNISTD_H]:
5085 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
5086 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
5087 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
5088 * lread.c (Qinternal_interpreter_environment):
5089 * minibuf.c (Qbuffer):
5090 * process.c (QCfamily, QCfilter):
5091 * widget.c (free_frame_faces):
5092 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
5093 * xfont.c (x_clear_errors):
5094 * xterm.c (x_frame_parm_handlers):
5095 Remove now-redundant extern decls.
5096 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
5097 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
5098 Now static.
5099 * xfaces.c: Remove unnecessary static decls.
5100 * xterm.c (updating_frame): Remove decl of nonexistent object.
5101
c04889f8
PE
5102 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
5103 when building globals.h, as the objects that are not built on
5104 this host are not needed to compile C files on this host.
5105
8b339673
JD
51062012-09-02 Jan Djärv <jan.h.d@swipnet.se>
5107
5108 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
5109
5110 * frame.h: Add missing prototype for x_wm_set_size_hint.
5111
a08d4ba7
PE
51122012-09-02 Paul Eggert <eggert@cs.ucla.edu>
5113
5114 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
5115 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
5116 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
5117 (Fsubstitute_command_keys):
5118 * editfns.c (region_limit, find_field, Fconstrain_to_field)
5119 (save_excursion_save, save_excursion_restore)
5120 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
5121 (format_time_string, general_insert_function)
5122 (make_buffer_string, make_buffer_string_both)
5123 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
5124 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
5125 (copy_text, insert_1, insert_1_both, insert_from_string)
5126 (insert_from_string_before_markers, insert_from_string_1)
5127 (insert_from_buffer, insert_from_buffer_1, replace_range)
5128 (replace_range_2, del_range_1, del_range_byte, del_range_both)
5129 (del_range_2, modify_region):
5130 * intervals.c (intervals_equal, balance_possible_root_interval)
5131 (adjust_intervals_for_insertion, merge_properties_sticky)
5132 (graft_intervals_into_buffer, lookup_char_property)
5133 (adjust_for_invis_intang, set_point_both)
5134 (get_property_and_range, compare_string_intervals)
5135 (set_intervals_multibyte_1, set_intervals_multibyte):
5136 * keyboard.c (decode_timer):
5137 Use bool for boolean.
5138 * intervals.h, lisp.h, systime.h: Reflect above API changes.
5139 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
5140
48c948de
CY
51412012-09-02 Chong Yidong <cyd@gnu.org>
5142
5143 * keymap.c (push_key_description): Print M-TAB as C-M-i
5144 (Bug#11758).
5145
6c49a40b
JB
51462012-09-02 Juanma Barranquero <lekktu@gmail.com>
5147
5148 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
5149 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
5150 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
5151 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
5152 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
5153 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
5154 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
5155
4dfbd238
EZ
51562012-09-01 Eli Zaretskii <eliz@gnu.org>
5157
7e510e28
EZ
5158 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
5159 more than one grapheme cluster passed to the shaper: compute the
5160 offset adjustment values separately for each cluster. (Bug#11860)
5161
4dfbd238
EZ
5162 * image.c: Restore mistakenly removed inclusion of w32.h. Without
5163 it, GCC doesn't see prototypes of w32_delayed_load, and complains
5164 about implicit conversions from integer to pointer.
5165
86571ae0
DC
51662012-09-01 Daniel Colascione <dancol@dancol.org>
5167
5168 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
5169 system used too early.
5170
0e23ef9d
PE
51712012-09-01 Paul Eggert <eggert@cs.ucla.edu>
5172
5173 Better seed support for (random).
5174 * emacs.c (main): Call init_random.
5175 * fns.c (Frandom): Set the seed from a string argument, if given.
5176 Remove long-obsolete Gentzel cruft.
5177 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
5178 (init_random): New function.
5179
17a2cbbd
DC
51802012-09-01 Daniel Colascione <dancol@dancol.org>
5181
5182 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
5183 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
5184 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
5185 x_wm_set_size_hint, x_query_colors, x_real_positions,
5186 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
5187 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
5188 all of which have been moved to common code.
5189
5190 * xfaces.c: Include TERM_HEADER instead of listing all possible
5191 window-system headers.
5192
5193 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
5194 to match header.
5195
5196 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
5197 directly accessing frame internals.
5198
f18cbb28 5199 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
5200 globals_of_w32font.
5201
5202 * process.c: Include TERM_HEADER instead of listing all possible
5203 window-system headers.
5204
3a880af4
SM
5205 * nsterm.h: Remove declarations now in frame.h.
5206 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
5207
5208 * menu.c: Include TERM_HEADER instead of listing all possible
5209 window-system headers.
5210
5211 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
5212 window system.
5213
5214 * keyboard.c: Include TERM_HEADER instead of listing all possible
5215 window-system headers.
5216
5217 * image.c: Include TERM_HEADER instead of listing all possible
5218 window-system headers. Declare Vlibrary_cache when compiling for
5219 Windows.
5220
5221 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
5222 window system declarations.
5223
5224 * frame.h: Move common functions here: set_frame_menubar,
5225 x_set_window_size, x_sync, x_get_focus_frame,
5226 x_set_mouse_position, x_set_mouse_pixel_position,
5227 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
5228 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
5229 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
5230 x_activate_menubar, x_real_positions, x_bitmap_icon,
5231 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
5232 and x_query_colors.
5233
5234 * frame.c: Include TERM_HEADER instead of listing all possible
5235 window-system headers.
5236
5237 * font.c: Include TERM_HEADER instead of listing all possible
5238 window-system headers.
5239
5240 * emacs.c: Include TERM_HEADER.
5241
f18cbb28
EZ
5242 * dispnew.c: Include TERM_HEADER instead of listing all possible
5243 window-system headers.
17a2cbbd 5244
f18cbb28 5245 * ccl.h: Include character.h.
17a2cbbd
DC
5246
5247 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
5248 the current window system; include in list of objects to link into
5249 Emacs.
5250
c650a5de
DA
52512012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
5252
5253 Remove mark_ttys function and fix tty_display_info initialization.
5254 * lisp.h (mark_ttys): Remove prototype.
5255 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
5256 to mark_ttys because all possible values of 'top_frame' slot are
5257 the frames which are reachable from Vframe_list.
5258 * term.c (mark_ttys): Remove.
5259 (init_tty): Safely initialize 'top_frame' slot with Qnil.
5260
4e0f6479
DA
52612012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
5262
5263 Change struct frame bitfields from unsigned char to unsigned.
5264 * frame.h (struct frame): Change type of 'display_preempted',
5265 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
5266 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
5267 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
5268 bitfields from unsigned char to unsigned.
5269
8b96a52c
DA
52702012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
5271
5272 Remove unused member of struct x_output and struct w32_output.
5273 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
5274 * w32term.h (struct w32_output): Likewise.
5275
b4444c8a
JD
52762012-08-30 Jan Djärv <jan.h.d@swipnet.se>
5277
5278 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
5279 does not become zero (Bug#12234).
5280
b98521db
PE
52812012-08-30 Paul Eggert <eggert@cs.ucla.edu>
5282
5283 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
5284 for GCC 4.7.1 x86-64.
5285
31d02438
GM
52862012-08-30 Glenn Morris <rgm@gnu.org>
5287
5288 * lread.c (init_lread): For out-of-tree builds, only add the
5289 source directory's site-lisp dir to the load-path if it exists,
5290 consistent with in-tree builds. (Bug#12302)
5291
7f8941d8
JD
52922012-08-28 Jan Djärv <jan.h.d@swipnet.se>
5293
5294 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 5295 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
5296 (windowShouldClose:): Set window_closed.
5297 (dealloc): New member, free button_values.
fc0c31f8
JB
5298 (process_dialog:): Make member function. Remove window argument,
5299 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
5300 in button_values.
5301 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 5302 with tag. Remove return self, declare return value as void.
7f8941d8
JD
5303 (addString:row:): Remove return self, declare return value as void.
5304 (addSplit): Remove return self, declare return value as void.
5305 (clicked:): Remove return self, declare return value as void.
fc0c31f8 5306 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
5307 (initFromContents:isQuestion:): Adjust call to process_dialog.
5308 Code formatting change.
5309 (timeout_handler:): Set timer_fired to YES.
5310 (runDialogAt:): Set timer_fired to NO.
5311 Handle click on close button as quit.
5312
5313 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
5314 Add window_closed and button_values. Add void as return value for
5315 add(Button|String|Split). addButton takes int instead of Lisp_Object.
5316 Add process_dialog as new member.
5317
eada0861 53182012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 5319
eada0861
GM
5320 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
5321 is not one of the heaps we manage. (Bug#12242)
5322
53232012-08-28 Glenn Morris <rgm@gnu.org>
5324
5325 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
5326
457294dd
MR
53272012-08-28 Martin Rudalics <rudalics@gmx.at>
5328
5329 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
5330 auto-buffer-name window parameter. Install revision of reverted
5331 fix.
457294dd 5332
4f2daf31
DA
53332012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
5334
5335 Do not allow to set major mode for a dead buffer.
5336 * buffer.c (Fset_buffer_major_mode): Signal an error
5337 if the buffer is dead.
5338 (Fother_buffer, other_buffer_safely): Remove redundant
5339 nested declaration.
5340
66322887
DA
53412012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
5342
5343 Always use set_buffer_if_live to restore original buffer at unwind.
5344 * buffer.h (record_unwind_current_buffer): New function.
5345 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
5346 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
5347 * undo.c, window.c: Adjust users.
5348 * buffer.c (set_buffer_if_live): Fix comment.
5349
a3d794a1
DA
53502012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
5351
5352 Fix usage of set_buffer_internal.
5353 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
5354 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
5355 * coding.c (decode_coding): Omit redundant test.
5356 * fileio.c (decide_coding_unwind): Likewise.
5357 * fns.c (secure_hash): Likewise.
5358 * insdel.c (modify_region): Likewise.
5359 * keyboard.c (command_loop_1): Likewise.
5360 * print.c (PRINTFINISH): Likewise.
5361 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
5362
59ea14cd
PE
53632012-08-27 Paul Eggert <eggert@cs.ucla.edu>
5364
5365 * dispnew.c: Use bool for boolean.
5366 (frame_garbaged, display_completed, delayed_size_change)
5367 (fonts_changed_p, add_window_display_history)
5368 (add_frame_display_history, verify_row_hash)
5369 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
5370 (row_equal_p, realloc_glyph_pool)
5371 (allocate_matrices_for_frame_redisplay)
5372 (showing_window_margins_p)
5373 (adjust_frame_glyphs_for_frame_redisplay)
5374 (build_frame_matrix_from_leaf_window, make_current)
5375 (mirrored_line_dance, mirror_line_dance, update_frame)
5376 (update_window_tree, update_single_window)
5377 (check_current_matrix_flags, update_window, update_text_area)
5378 (update_window_line, set_window_update_flags, scrolling_window)
5379 (update_frame_1, scrolling, buffer_posn_from_coords)
5380 (do_pending_window_change, change_frame_size)
5381 (change_frame_size_1, sit_for):
5382 Use bool for boolean.
5383 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
5384 and remove last int (actually boolean) argument, which was always 0.
5385 All callers changed.
5386 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
5387 * dispextern.h (struct composition_it): Use bool for boolean.
5388 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
5389 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
5390 * dired.c (file_name_completion):
5391 Use bool for boolean. (This was missed in an earlier change.)
5392
95072a94
MR
53932012-08-27 Martin Rudalics <rudalics@gmx.at>
5394
5395 * window.c (Fset_window_configuration): Revert first part of
5396 last change.
5397
0f19feff
JD
53982012-08-27 Jan Djärv <jan.h.d@swipnet.se>
5399
5400 * nsterm.h (NSPanel): New class variable dialog_return.
5401
3a880af4
SM
5402 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
5403 Initialize dialog_return.
0f19feff
JD
5404 (windowShouldClose:): Use stop instead of stopModalWithCode.
5405 (clicked:): Ditto, and also set dialog_return (Bug#12258).
5406 (timeout_handler:): Use stop instead of abortModal. Send a dummy
5407 event.
5408 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
5409 modal loop returns.
5410
f10fe38f
PE
54112012-08-27 Paul Eggert <eggert@cs.ucla.edu>
5412
de1339b0
PE
5413 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
5414 * composite.c (find_composition, composition_gstring_p)
5415 (composition_reseat_it, find_automatic_composition):
5416 * data.c (let_shadows_buffer_binding_p)
5417 (let_shadows_global_binding_p, set_internal, make_blv)
5418 (Fmake_variable_buffer_local, Fmake_local_variable)
5419 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
5420 (cons_to_signed, arith_driver):
5421 * dbusbind.c (xd_in_read_queued_messages):
5422 * dired.c (directory_files_internal, file_name_completion):
5423 Use bool for booleans.
5424 * dired.c (file_name_completion):
5425 * process.h (fd_callback):
5426 Omit int (actually boolean) argument. It wasn't being used.
5427 All uses changed.
5428 * composite.h, lisp.h: Reflect above API changes.
5429
f10fe38f
PE
5430 * cmds.c, coding.c: Use bool for booleans.
5431 * cmds.c (move_point, Fself_insert_command):
5432 * coding.h (struct composition status, struct coding_system):
5433 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
5434 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
5435 (emacs_mule_char, decode_coding_emacs_mule)
5436 (encode_coding_emacs_mule, detect_coding_iso_2022)
5437 (decode_coding_iso_2022, encode_invocation_designation)
5438 (encode_designation_at_bol, encode_coding_iso_2022)
5439 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
5440 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
5441 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
5442 (encode_coding_raw_text, detect_coding_charset)
5443 (decode_coding_charset, encode_coding_charset, detect_eol)
5444 (detect_coding, get_translation_table, produce_chars)
5445 (consume_chars, reused_workbuf_in_use)
5446 (make_conversion_work_buffer, code_conversion_save)
5447 (decode_coding_object, encode_coding_object)
5448 (detect_coding_system, char_encodable_p)
5449 (Funencodable_char_position, code_convert_region)
5450 (code_convert_string, code_convert_string_norecord)
5451 (Fset_coding_system_priority):
5452 * fileio.c (Finsert_file_contents):
5453 Use bool for booleans.
5454 * coding.h, lisp.h: Reflect above API changes.
5455 * coding.c: Remove unnecessary static function decls.
5456 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
5457 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
5458 not a boolean 'int', since callers never look at the return value.
5459 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
5460 * coding.h (decoding_buffer_size, encoding_buffer_size)
5461 (emacs_mule_string_char): Remove unused extern decls.
5462 (struct iso_2022_spec, struct coding_system):
5463 Use 'unsigned int : 1' for boolean fields, since there's more than one.
5464 (struct emacs_mule_spec): Remove unused field 'full_support'.
5465 All initializations removed.
5466 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
5467
5474c384
DA
54682012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
5469
f10fe38f 5470 Fix spare memory change (Bug#12286).
5474c384
DA
5471 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
5472 (valid_lisp_object_p): Likewise.
5473
c4b6914d
MR
54742012-08-27 Martin Rudalics <rudalics@gmx.at>
5475
5476 * window.c (Fset_window_configuration): Record any window's old
5477 buffer if it's replaced (see Bug#8789). If the new current
5478 buffer doesn't appear in the selected window, go to its old
5479 point (Bug#12208).
5480
35aaa1ea
DA
54812012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
5482
5483 Special MEM_TYPE_SPARE to denote reserved memory.
5484 * alloc.c (enum mem_type): New memory type.
5485 (refill_memory_reserve): Use new type for spare memory.
5486 This prevents live_cons_p and live_string_p from incorrect
5487 detection of uninitialized objects from spare memory as live.
5488
6af64513
PE
54892012-08-26 Paul Eggert <eggert@cs.ucla.edu>
5490
8b2e00a3
PE
5491 Spelling fixes.
5492 * Makefile.in (.PHONY): versioclean -> versionclean.
5493
b52d6985
PE
5494 Remove unused external symbols.
5495 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
5496 * window.c (Qwindow_valid_p, decode_valid_window):
5497 Now static, not extern.
5498 * data.c (Qinterval): Remove; unused.
5499 (syms_of_data): Do not define 'interval'.
5500 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
5501 * window.h (decode_valid_window):
5502 Remove decls.
5503
d5172d4f
PE
5504 * character.c, charset.c, chartab.c: Use bool for booleans.
5505 * character.c (lisp_string_width, string_count_byte8)
5506 (string_escape_byte8):
5507 * charset.c (charset_map_loaded, load_charset_map, read_hex):
5508 (load_charset_map_from_file, map_charset_chars)
5509 (Fdefine_charset_internal, define_charset_internal)
5510 (Fdeclare_equiv_charset, find_charsets_in_text)
5511 (Ffind_charset_region, char_charset, Fiso_charset):
5512 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
5513 (sub_char_table_set, sub_char_table_set_range)
5514 (char_table_set_range, optimize_sub_char_table)
5515 (map_sub_char_table):
5516 Use bool for boolean.
5517 * character.c (str_to_unibyte): Omit last boolean argument; it was
5518 always 0. All callers changed.
5519 * character.h, charset.h: Adjust to match previous changes.
5520 * character.h (char_printable_p): Remove decl of nonexistent function.
5521 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
5522 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
5523 are all boolean, so make them single-bit bitfields.
5524
6af64513
PE
5525 * lisp.h (ASET): Remove attempt to detect side effects.
5526 It was meant to be temporary and it often doesn't work,
5527 because when IDX has side effects the behavior of IDX==IDX
5528 is undefined. See Stefan Monnier in
5529 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
5530
e1f29348
BR
55312012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
5532
5533 * lisp.h (functionp): New function (extracted from Ffunctionp).
5534 (FUNCTIONP): Use it.
5535 * eval.c (Ffunctionp): Use it.
5536
17c05d74
PE
55372012-08-25 Paul Eggert <eggert@cs.ucla.edu>
5538
0f46bc75
PE
5539 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
5540 as that's faster and simpler than static storage. Don't bother
5541 with the g_main_context_query overhead if g_main_context_pending
5542 says no events are pending.
5543 (gfds, gfds_size): Remove these static vars.
5544 (xgselect_initialize): Remove; no longer needed.
5545 All uses and decls removed.
5546
ee4c0f69
PE
5547 * emacs.c (fatal_error_signal_hook): Remove.
5548 All uses removed. This leftover from old code was always 0.
5549
17c05d74
PE
5550 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
5551 * casefiddle.c (casify_object, casify_region):
5552 * casetab.c (set_case_table):
5553 * category.c, category.h (word_boundary_p):
5554 * category.h (CHAR_HAS_CATEGORY):
5555 Use bool for booleans, instead of int.
5556
391ceac5
EZ
55572012-08-25 Eli Zaretskii <eliz@gnu.org>
5558
5559 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
5560
2f221583
PE
55612012-08-25 Paul Eggert <eggert@cs.ucla.edu>
5562
f4a681b0
PE
5563 On assertion failure, print backtrace if available.
5564 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
5565 (die) [ENABLE_CHECKING]: Print a backtrace if available.
5566 * Makefile.in (LIB_EXECINFO): New macro.
5567 (LIBES): Use it.
5568
2f221583
PE
5569 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
5570 * bytecode.c (exec_byte_code):
5571 * callint.c (check_mark, Fcall_interactively):
5572 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
5573 (getenv_internal, sync_process_alive, call_process_exited):
5574 * lisp.h (USE_SAFE_ALLOCA):
5575 Use bool for booleans, instead of int.
5576 * lisp.h, process.h: Adjust prototypes to match above changes.
5577 * callint.c (Fcall_interactively): Don't assume the mark's
5578 offset fits in 'int'.
5579
37ef52bb
PE
55802012-08-24 Paul Eggert <eggert@cs.ucla.edu>
5581
5582 * buffer.c, buffer.h: Use bool for boolean.
5583 * buffer.c (reset_buffer_local_variables)
5584 (buffer_lisp_local_variables, Fset_buffer_modified_p)
5585 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
5586 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
5587 (overlay_touches_p, overlay_strings, Foverlay_put)
5588 (report_overlay_modification, call_overlay_mod_hooks):
5589 (mmap_enlarge, mmap_set_vars):
5590 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
5591 Use bool for booleans, instead of int.
5592 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
5593 since the 1-or-0 return value is always ignored anyway.
5594 (mmap_initialized_p):
5595 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
5596 * buffer.h, lisp.h: Adjust prototypes to match above changes.
5597
2cc21167
PE
55982012-08-23 Paul Eggert <eggert@cs.ucla.edu>
5599
5600 * bidi.c: Use bool for boolean.
5601 This is a bit more readable, and makes the text segment of bidi.o
5602 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
5603 Presumably it's faster too.
5604 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
5605 Now bool.
5606 (bidi_cache_find_level_change, bidi_cache_iterator_state)
5607 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
5608 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
5609 (bidi_explicit_dir_char, bidi_level_of_next_char)
5610 (bidi_find_other_level_edge, bidi_move_to_visually_next):
5611 Use bool for booleans, instead of int.
5612 * dispextern.h (bidi_init_it, bidi_paragraph_init)
5613 (bidi_unshelve_cache): Adjust decls to match code.
5614
7db4ddf4
MR
56152012-08-23 Martin Rudalics <rudalics@gmx.at>
5616
5617 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
5618 argument.
5619
b1bb8011
PE
56202012-08-23 Paul Eggert <eggert@cs.ucla.edu>
5621
5622 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
5623 * atimer.h: Include <stdbool.h>.
5624
ff687885
DN
56252012-08-22 Dan Nicolaescu <dann@gnu.org>
5626
5627 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
5628 compile time tests instead of run time tests on systems that do
5629 not use them.
5630 (FRAME_MAC_P): Remove leftover from deleted code.
5631 * frame.c (syms_of_frame): Remove leftover from deleted code.
5632
4ce7a138
JD
56332012-08-22 Jan Djärv <jan.h.d@swipnet.se>
5634
5635 * nsterm.m (insertText:): Don't clear modifiers if code is space.
5636
d733ec6d
PE
56372012-08-22 Paul Eggert <eggert@cs.ucla.edu>
5638
5639 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
5640 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 5641 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
5642 (fontset_add): Return void, for FONTSET_ADD.
5643
d0d2d26f
PE
56442012-08-21 Paul Eggert <eggert@cs.ucla.edu>
5645
fce31d69
PE
5646 * alloc.c: Use bool for booleans.
5647 (gc_in_progress, abort_on_gc)
5648 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
5649 (dont_register_blocks) [GC_MALLOC_CHECK]:
5650 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
5651 (check_string_bytes, make_specified_string, memory_full)
5652 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
5653 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
5654 (mark_stack, valid_pointer_p, make_pure_string)
5655 (Fgarbage_collect, survives_gc_p, gc_sweep):
5656 Use bool for booleans, instead of int.
5657 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
5658 Remove unused local.
5659 * alloc.c (PURE_POINTER_P):
5660 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
5661 * editfns.c (Fformat):
5662 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
5663 (Fdo_auto_save):
5664 * fns.c (sweep_weak_table):
5665 * lisp.h (suppress_checking, push_message, survives_gc_p)
5666 (make_pure_string, gc_in_progress, abort_on_gc):
5667 * lread.c (readchar, read1):
5668 * print.c (Fprin1_to_string):
5669 * xdisp.c (push_message):
5670 Use bool for booleans affected directly or indirectly by
5671 alloc.c's changes.
5672
d0d2d26f
PE
5673 Make recently-introduced setters macros.
5674 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
5675 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
5676 (set_fontset_default, set_fontset_fallback): Rename from their
5677 upper-case counterparts, and make them functions rather than macros.
5678 This is more consistent with the other recently-introduced setters.
5679 These don't need to be inline, since they're local.
5680
d18e2bb6
JD
56812012-08-21 Jan Djärv <jan.h.d@swipnet.se>
5682
5683 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
5684 the loop (Bug#12247).
5685
1b9d9d16
PE
56862012-08-21 Paul Eggert <eggert@cs.ucla.edu>
5687
5688 * lisp.h (vcopy): Use memcpy rather than our own loop.
5689 This fixes a performance regression introduced by the recent
5690 addition of vcopy. This means 'vcopy' will need to be modified
5691 for a copying collector, but that's OK. Also, tighten the
5692 checking in the assertion.
5693
b2f09701
EZ
56942012-08-21 Eli Zaretskii <eliz@gnu.org>
5695
5696 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
5697 components for RTL text (Bug#11860). Adjust X-OFFSET of each
5698 non-base glyph for the width of the base character, according to
e1f29348
BR
5699 what x_draw_composite_glyph_string_foreground expects.
5700 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
5701 expectations, to produce correct width of the composed character.
5702 Reverse the sign of the DU offset produced by ScriptPlace.
5703
9b994fed
PE
57042012-08-21 Paul Eggert <eggert@cs.ucla.edu>
5705
5706 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
5707
086ca913
DA
57082012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
5709
5710 Avoid direct writes to contents member of struct Lisp_Vector.
5711 * lisp.h (vcopy): New function to copy data into vector.
5712 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
5713 * fns.c (Ffillarray): Use ASET.
5714 * keyboard.c (timer_check_2): Use AREF and ASET.
5715 (append_tool_bar_item, Frecent_keys): Use vcopy.
5716 * lread.c (read_vector): Use ASET.
5717 * msdos.c (Frecent_doskeys): Use vcopy.
5718 * xface.c (Finternal_copy_lisp_face): Use vcopy.
5719 (Finternal_merge_in_global_face): Use ASET and vcopy.
5720 * xfont.c (xfont_list_pattern): Likewise.
5721
5481664a
MR
57222012-08-21 Martin Rudalics <rudalics@gmx.at>
5723
5724 * window.c (Fwindow_point): For the selected window always return
5725 the position of its buffer's point.
5726 (Fset_window_point): For the selected window always go in its
5727 buffer to the specified position.
5728
6d470bdd
DA
57292012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
5730
5731 Setter macros for fontsets.
5732 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
5733 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
5734 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
5735 Adjust users.
5736
24564fe1
GM
57372012-08-20 Glenn Morris <rgm@gnu.org>
5738
5739 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5740 Don't assume that `ln -f' works.
5741
0a05a035
EZ
57422012-08-20 Eli Zaretskii <eliz@gnu.org>
5743
5744 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
5745 and later about non-assignments with no effect. See discussion at
5746 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
5747 details.
5748
e46f2325
DA
57492012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5750
5751 Inline setter functions for Lisp_Objects slots of struct specbinding.
5752 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
5753 Adjust users.
5754
734fbd86
MR
57552012-08-20 Martin Rudalics <rudalics@gmx.at>
5756
5757 * window.c (select_window): Always make selected window's buffer
5758 current.
5759
f1a95992
DA
57602012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5761
5762 Use AREF and ASET for docstrings of category tables.
5763 * category.h (CATEGORY_DOCSTRING): Use AREF.
5764 (SET_CATEGORY_DOCSTRING): Use ASET.
5765 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
5766
e83064be
DA
57672012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5768
5769 Inline setter functions for hash table members.
5770 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
5771 (set_hash_hash, set_hash_index): Rename with _slot suffix.
5772 (set_hash_key_and_value, set_hash_index, set_hash_next)
5773 (set_hash_hash): New functions.
5774 * charset.c, fns.c: Adjust users.
5775
4ce60d2e
DA
57762012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5777
5778 Inline getter and setter functions for per-buffer values.
5779 * buffer.h (per_buffer_default, set_per_buffer_default)
5780 (per_buffer_value, set_per_buffer_value): New functions.
5781 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
5782 * buffer.c, data.c: Adjust users.
5783
c06c9690
JB
57842012-08-20 Juanma Barranquero <lekktu@gmail.com>
5785
5786 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
5787
32bd4250
PE
57882012-08-19 Paul Eggert <eggert@cs.ucla.edu>
5789
bad03192 5790 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
5791 as gnulib does this if the system doesn't.
5792 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
5793 Remove declaration. MS-Windows declares it on stdlib.h which is
5794 included by conf_post.h.
b69a6d22
PE
5795 * emacs.c (environ) [DOUG_LEA_MALLOC]:
5796 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
5797 * vm-limit.c: Include <unistd.h>, for 'environ'.
5798
22d7feb2
PE
5799 * unexaix.c, unexcoff.c: Include "mem-limits.h".
5800 (start_of_data): Remove decl; mem-limits.h provides it.
5801
32bd4250
PE
5802 * xdisp.c (handle_invisible_prop): Make it a bit faster
5803 and avoid a gcc -Wmaybe-uninitialized diagnostic.
5804
450809af
CY
58052012-08-19 Chong Yidong <cyd@gnu.org>
5806
5807 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
5808 ends (Bug#3874).
5809
9e677988
AS
58102012-08-19 Andreas Schwab <schwab@linux-m68k.org>
5811
6b1319ce
AS
5812 * .gdbinit: Use call instead of set when calling a function in the
5813 inferior.
5814
9e677988
AS
5815 * data.c (set_internal): Don't use set_blv_found.
5816 (Fkill_local_variable): Likewise.
5817
d7191076
AA
58182012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
5819
5820 * nsfont.m (ns_ascii_average_width): Ensure the string
5821 ascii_printable is initialized with a null-terminated character
5822 array. Otherwise, it can contain undesired extra characters.
5823
e757f1c6
PE
58242012-08-18 Paul Eggert <eggert@cs.ucla.edu>
5825
5826 port new setting code to Sun C 5.8 2005/10/13
5827 * chartab.c, lisp.h (char_table_set, char_table_set_range):
5828 Return void, not Lisp_Object. Otherwise, the compiler
5829 complains about (A?B:C) where B is void and C is Lisp_Object
5830 when compiling CHAR_TABLE_SET, due to the recent change to
5831 the API of sub_char_table_set_contents.
5832
a999ce26
CY
58332012-08-18 Chong Yidong <cyd@gnu.org>
5834
5835 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
5836 for the string case (Bug#3874).
5837
3f22b86f
PE
58382012-08-18 Paul Eggert <eggert@cs.ucla.edu>
5839
39eb03f1
PE
5840 * buffer.h (BSET): Remove (Bug#12215).
5841 Replace all uses with calls to new setter functions.
5842 (bset_bidi_paragraph_direction, bset_case_canon_table)
5843 (bset_case_eqv_table, bset_directory, bset_display_count)
5844 (bset_display_time, bset_downcase_table)
5845 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
5846 (bset_last_selected_window, bset_local_var_alist)
5847 (bset_mark_active, bset_point_before_scroll, bset_read_only)
5848 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
5849 (bset_width_table):
5850 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
5851 (bset_auto_fill_function, bset_auto_save_file_format)
5852 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
5853 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
5854 (bset_cache_long_line_scans, bset_case_fold_search)
5855 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
5856 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
5857 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
5858 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
5859 (bset_header_line_format, bset_indicate_buffer_boundaries)
5860 (bset_indicate_empty_lines, bset_invisibility_spec)
5861 (bset_left_fringe_width, bset_major_mode, bset_mark)
5862 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
5863 (bset_name, bset_overwrite_mode, bset_pt_marker)
5864 (bset_right_fringe_width, bset_save_length)
5865 (bset_scroll_bar_width, bset_scroll_down_aggressively)
5866 (bset_scroll_up_aggressively, bset_selective_display)
5867 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
5868 (bset_word_wrap, bset_zv_marker):
5869 * category.c (bset_category_table):
5870 * syntax.c (bset_syntax_table):
5871 New setter functions.
5872
6a09a33b
PE
5873 * process.h (PSET): Remove (Bug#12215).
5874 Replace all uses with calls to new setter functions.
5875 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5876 (PROCESS_INLINE): New macro.
5877 (pset_childp): New setter function.
5878 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
5879 * process.c (PROCESS_INLINE):
5880 Define to EXTERN_INLINE, so that the corresponding functions
5881 are compiled into code.
5882 (pset_buffer, pset_command, pset_decode_coding_system)
5883 (pset_decoding_buf, pset_encode_coding_system)
5884 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
5885 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
5886 (pset_type, pset_write_queue): New setter functions.
5887
e8c17b81
PE
5888 * window.h (WSET): Remove (Bug#12215).
5889 Replace all uses with calls to new setter functions.
5890 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5891 (WINDOW_INLINE): New macro.
5892 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
5893 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
5894 (wset_total_lines, wset_vertical_scroll_bar)
5895 (wset_window_end_pos, wset_window_end_valid)
5896 (wset_window_end_vpos): New setter functions.
5897 * window.c (WINDOW_INLINE):
5898 Define to EXTERN_INLINE, so that the corresponding functions
5899 are compiled into code.
5900 (wset_combination_limit, wset_dedicated, wset_display_table)
5901 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
5902 (wset_new_normal, wset_new_total, wset_next_buffers)
5903 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5904 (wset_prev_buffers, wset_right_fringe_width)
5905 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
5906 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
5907 (wset_window_parameters):
5908 * xdisp.c (wset_base_line_number, wset_base_line_pos)
5909 (wset_column_number_displayed, wset_region_showing):
5910 New setter functions.
5911
3f22b86f
PE
5912 * termhooks.h (TSET): Remove (Bug#12215).
5913 Replace all uses with calls to new setter functions.
5914 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5915 (TERMHOOKS_INLINE): New macro.
5916 (tset_charset_list, tset_selection_alist): New setter functions.
5917 * terminal.c (TERMHOOKS_INLINE):
5918 Define to EXTERN_INLINE, so that the corresponding functions
5919 are compiled into code.
5920 (tset_param_alist): New setter function.
5921
742af32f
PE
59222012-08-17 Paul Eggert <eggert@cs.ucla.edu>
5923
15dbb4d6
PE
5924 * keyboard.h (KSET): Remove (Bug#12215).
5925 Replace all uses with calls to new setter functions.
5926 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5927 (KEYBOARD_INLINE): New macro.
5928 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
5929 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
5930 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
5931 New setter functions.
5932 * keyboard.c (KEYBOARD_INLINE):
5933 Define to EXTERN_INLINE, so that the corresponding functions
5934 are compiled into code.
5935 (kset_echo_string, kset_kbd_queue)
5936 (kset_keyboard_translate_table, kset_last_prefix_arg)
5937 (kset_last_repeatable_command, kset_local_function_key_map)
5938 (kset_overriding_terminal_local_map, kset_real_last_command)
5939 (kset_system_key_syms): New setter functions.
5940
f00af5b1
PE
5941 * frame.h (FSET): Remove (Bug#12215).
5942 Replace all uses with calls to new setter functions.
5943 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5944 (FRAME_INLINE): New macro.
5945 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
5946 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
5947 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
5948 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
5949 (fset_param_alist, fset_root_window, fset_scroll_bars)
5950 (fset_selected_window, fset_title, fset_tool_bar_items)
5951 (fset_tool_bar_position, fset_tool_bar_window): New functions.
5952 * frame.c (FRAME_INLINE):
5953 Define to EXTERN_INLINE, so that the corresponding functions
5954 are compiled into code.
5955 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
5956
0c94c8d6
PE
5957 A few more naming-convention fixes for getters and setters.
5958 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
5959 and rename from buffer_overlays_set_before.
5960 (set_buffer_overlays_after): Move here from buffer.h, and rename
5961 from buffer_overlays_set_after.
5962 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
5963 All uses changed.
5964 (set_buffer_intervals): Rename from buffer_set_intervals.
5965 * intervals.c (set_interval_object): Move here from intervals.h,
5966 and rename from interval_set_object.
5967 (set_interval_left): Move here from intervals.h, and rename from
5968 interval_set_left.
5969 (set_interval_right): Move here from intervals.h, and rename from
5970 interval_set_right.
5971 (copy_interval_parent): Move here from intervals.h, and rename from
5972 interval_copy_parent.
5973 * intervals.h (set_interval_parent): Rename from interval_set_parent.
5974 (set_interval_plist): Rename from interval_set_plist.
5975 Return void, not Lisp_Object, since no caller uses the result.
5976 * lisp.h (string_intervals): Rename from string_get_intervals.
5977 (set_string_intervals): Rename from string_set_intervals.
5978
34dabdb7
PE
5979 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
5980 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 5981 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
5982 All uses changed. See the end of
5983 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
5984
742af32f
PE
5985 * lisp.h (CSET): Remove (Bug#12215).
5986 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
5987 (set_char_table_purpose): New functions,
5988 replacing CSET. All uses changed. For example, replace
5989 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 5990 "set_char_table_parent (char_table, parent);".
742af32f
PE
5991 The old version was confusing because it used the same name
5992 'parent' for two different things.
5993
a04e2c62
DA
59942012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
5995
5996 Functions to get and set Lisp_Object fields of buffer-local variables.
5997 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
5998 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
5999 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
6000 * data.c, eval.c, frame.c: Adjust users.
6001
383dcbf9
CY
60022012-08-17 Chong Yidong <cyd@gnu.org>
6003
6004 * xfaces.c (merge_face_vectors): If the target font specfies a
6005 font spec, make the font's attributes take precedence over
6006 directly-specified attributes.
6007 (merge_face_ref): Recognize :font.
6008
44386687
DA
60092012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
6010
6011 Do not use memcpy for copying intervals.
6012 * intervals.c (reproduce_interval): New function.
6013 (reproduce_tree, reproduce_tree_obj): Use it.
6014 (reproduce_tree_obj): Remove prototype.
6015
927c7216
PE
60162012-08-17 Paul Eggert <eggert@cs.ucla.edu>
6017
6018 * lisp.h (duration_to_sec_usec): Remove unused decl.
6019
93044f7b
AA
60202012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
6021
6022 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
6023 to an allocated instance of NSString, not to the class itself.
6024
9851e4a5
JB
60252012-08-17 Juanma Barranquero <lekktu@gmail.com>
6026
6027 * makefile.w32-in (C_CTYPE_H): New macro.
6028 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
6029 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
6030 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
6031
620f13b0
PE
60322012-08-16 Paul Eggert <eggert@cs.ucla.edu>
6033
6034 Use ASCII tests for character types.
6035 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
6036 * xfns.c, xterm.c:
6037 Don't include <ctype.h>; was not needed.
6038 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
6039 * sysdep.c, xfaces.c:
6040 Include <c-ctype.h> instead of <ctype.h>.
6041 * nsterm.m: Include <c-ctype.h>.
6042 * charset.c (read_hex):
6043 * doc.c (Fsnarf_documentation):
6044 * fileio.c (IS_DRIVE) [WINDOWSNT]:
6045 (DRIVE_LETTER) [DOS_NT]:
6046 (Ffile_name_directory, Fexpand_file_name)
6047 (Fsubstitute_in_file_name):
6048 * font.c (font_parse_xlfd, font_parse_fcname):
6049 * frame.c (x_set_font_backend):
6050 * gtkutil.c (xg_get_font):
6051 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
6052 * nsimage.m (hexchar):
6053 * nsterm.m (ns_xlfd_to_fontname):
6054 * sysdep.c (system_process_attributes):
6055 * xfaces.c (hash_string_case_insensitive):
6056 Use C-locale tests instead of locale-specific tests for character
6057 types, since we want the ASCII interpretation here, not the
6058 interpretation suitable for whatever happens to be the current locale.
6059
52162052
MR
60602012-08-16 Martin Rudalics <rudalics@gmx.at>
6061
6062 Consistently check windows for validity/liveness
6063 (Bug#11984, Bug#12025, Bug#12026).
6064 * lisp.h (CHECK_VALID_WINDOW): New macro.
6065 * window.c (decode_window): Rename to decode_live_window.
6066 (decode_valid_window, Fwindow_valid_p): New functions.
6067 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
6068 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
6069 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
6070 (Fwindow_prev_sibling, Fwindow_combination_limit)
6071 (Fset_window_combination_limit, Fwindow_use_time)
6072 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
6073 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
6074 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
6075 (Fwindow_hscroll, Fset_window_hscroll)
6076 (Fwindow_redisplay_end_trigger)
6077 (Fset_window_redisplay_end_trigger, Fwindow_edges)
6078 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
6079 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
6080 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
6081 (Fwindow_end, Fset_window_point, Fset_window_start)
6082 (Fpos_visible_in_window_p, Fwindow_line_height)
6083 (Fwindow_dedicated_p, Fset_window_dedicated_p)
6084 (Fwindow_prev_buffers, Fset_window_prev_buffers)
6085 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
6086 (Fset_window_parameter, Fwindow_display_table)
6087 (Fset_window_display_table, Fdelete_other_windows_internal)
6088 (Fset_window_buffer, Fset_window_new_total)
6089 (Fset_window_new_normal, Fdelete_window_internal)
6090 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
6091 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
6092 (Fwindow_scroll_bars): Check whether argument window is a valid or
6093 live window. Update doc-strings.
6094 (syms_of_window): New symbol Qwindow_valid_p.
6095 * keyboard.c (Fposn_at_x_y): Check whether argument
6096 frame_or_window denotes a valid window.
6097
2751c80f
DA
60982012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
6099
6100 Fix previous char table change.
6101 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
6102 * chartab.c (optimize_sub_char_table): Likewise.
6103
032a42c8
CY
61042012-08-16 Chong Yidong <cyd@gnu.org>
6105
a2d19368
CY
6106 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
6107
032a42c8
CY
6108 * xfont.c (xfont_open):
6109 * xftfont.c (xftfont_open): Set the font's max_width field.
6110
6111 * nsfont.m (nsfont_open): Similar to the Xft backend, set
6112 min_width to space_width and average_width to the average over
6113 printable ASCII characters.
6114 (ns_char_width): Code cleanup.
6115 (ns_ascii_average_width): New utility function.
6116
6117 * font.h (struct font): Update comments.
6118
a098c930
DA
61192012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
6120
032a42c8 6121 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
6122 * lisp.h (CSET): New macro.
6123 (char_table_set_extras, char_table_set_contents)
6124 (sub_char_table_set_contents): New function.
6125 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
6126 * syntax.c: Adjust users.
6127
8be3a09c
SM
61282012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
6129
6130 * eval.c (eval_sub): Bind lexical-binding.
6131 * lread.c (Qlexical_binding): Make non-static.
6132
ac4845a6
JD
61332012-08-15 Jan Djärv <jan.h.d@swipnet.se>
6134
ddee6515
JD
6135 * nsmenu.m (popupSession): Remove.
6136 (pop_down_menu): Remove endModalSession.
6137 (timeout_handler:): New method.
6138 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
6139 Call runModalForWindow. Check timer_fired when it returns.
6140 If not set, cancel timer and break out of loop.
6141 Otherwise loop again, with a new timeout.
6142
6143 * nsterm.m: Include fcntl.h if present.
6144 (fd_entry, t_readfds, inNsSelect): Remove.
6145 (select_writefds, select_valid, select_timeout, selfds)
6146 (select_mutex, apploopnr): Add.
6147 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
6148 Otherwise call kbd_buffer_store_event.
6149 (ns_send_appdefined): Remove release of fd_entry.
6150 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
6151 Increment and decrement apploopnr.
6152 (ns_select): If no file descriptors, just do a NSTimer.
6153 Otherwise copy read/write masks and start select thread (fd_handler).
6154 Start main loop and wait for application defined event.
6155 Inform select thread to stop selecting after main loop is exited.
6156 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 6157 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
6158 (fd_handler:): Loop forever, wait for info from the main thread
6159 to either start or stop selecting. When select returns, send
6160 and appdefined event.
6161 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
6162 If not call kbd_buffer_store_event.
6163
6164 * nsterm.h (EmacsApp): fd_handler takes id argument.
6165 (EmacsDialogPanel): Add timer_fired and timeout_handler.
6166
ac4845a6
JD
6167 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
6168
eb424fe3
EZ
61692012-08-15 Eli Zaretskii <eliz@gnu.org>
6170
6171 * region-cache.c (move_cache_gap): Update gap_len using the actual
6172 growth of the boundaries array. Do not change cache_len.
6173 (Bug#12196)
6174
4e6a86c6
DA
61752012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
6176
6177 Generalize and cleanup font subsystem checks.
6178 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
6179 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
6180 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 6181
5bf192ca
DA
61822012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
6183
6184 * gtkutil.c (xg_get_font): Use pango_units_to_double.
6185
f2045622
CY
61862012-08-15 Chong Yidong <cyd@gnu.org>
6187
8be3a09c
SM
6188 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
6189 When using the new font chooser, use gtk_font_chooser_get_font_desc to
6190 extract the font descriptor instead of just the font name.
6191 In that case, return a font spec instead of a string.
f2045622
CY
6192 (x_last_font_name): Move to this file from xfns.c.
6193
6194 * xfns.c (Fx_select_font): The return value can also be a font
6195 spec. Move x_last_font_name management to gtkutil.c.
6196
6197 * xfaces.c: Make font weight and style symbols non-static.
6198
7f6feb56
SM
61992012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
6200
6201 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
6202 (bug#12117).
6203
fecbd8ff
SM
62042012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
6205
6206 * alloc.c (Fgarbage_collect): Use plural form consistently.
6207
9b8d5165
EZ
62082012-08-14 Eli Zaretskii <eliz@gnu.org>
6209
6210 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
6211 iteration through the command loop. Fixes a problem whereby mouse
6212 movements are ignored until the first mouse click.
6213
f5d9e83a
PE
62142012-08-14 Paul Eggert <eggert@cs.ucla.edu>
6215
6216 Use bool, not int, for Lisp booleans.
6217 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
6218 makes Emacs a bit smaller and presumably a bit faster.
6219 * lisp.h: Include <stdbool.h>.
6220 (struct Lisp_Boolfwd, defvar_bool):
6221 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
6222 * regex.c [!emacs]: Include <stdbool.h>.
6223 (false, true): Remove; <stdbool.h> does this for us now.
6224
55802e4a
CY
62252012-08-14 Chong Yidong <cyd@gnu.org>
6226
4abcdac8
CY
6227 * character.c (Fcharacterp): Doc fix (Bug#12076).
6228
6229 * data.c (Findirect_variable): Doc fix (Bug#11040).
6230
55802e4a
CY
6231 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
6232
6233 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 6234 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 6235
8e99d072
BR
62362012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
6237
6238 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
6239 (bug#12022).
6240
08908aca
MR
62412012-08-14 Martin Rudalics <rudalics@gmx.at>
6242
6243 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
6244 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
6245 * minibuf.c (choose_minibuf_frame, read_minibuf):
6246 * w32fns.c (x_create_tip_frame):
6247 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
6248 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
6249
56120d6f
PE
62502012-08-14 Paul Eggert <eggert@cs.ucla.edu>
6251
6252 * intervals.c (offset_intervals): Remove obsolete comment.
6253
67b77c0b
AS
62542012-08-14 Andreas Schwab <schwab@linux-m68k.org>
6255
6256 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
6257
f48b82fd
GR
62582012-08-14 Gergely Risko <gergely@risko.hu>
6259
6260 * coding.c (decode_coding): Record buffer modification before
6261 disabling undo_list (Bug#11773).
6262
fd318b54
DA
62632012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
6264
6265 Revert and cleanup some recent overlay changes.
6266 * buffer.h (enum overlay_type): Remove.
6267 (buffer_get_overlays, buffer_set_overlays): Likewise.
6268 (buffer_set_overlays_before, buffer_set_overlays_after):
6269 New function. Adjust users.
6270 (unchain_both): Add eassert.
6271
41a62dd9
DA
62722012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
6273
6274 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
6275
5884c324
PE
62762012-08-14 Paul Eggert <eggert@cs.ucla.edu>
6277
6278 * gtkutil.c (xg_mark_data): Don't assume C99.
6279
ca06f160
JD
62802012-08-13 Jan Djärv <jan.h.d@swipnet.se>
6281
6282 * gtkutil.c (xg_frame_tb_info): New struct.
6283 (TB_INFO_KEY): New define.
6284 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
6285 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
6286 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
6287 if not present.
6288 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 6289 is up to date. Otherwise store new data.
ca06f160
JD
6290 (free_frame_tool_bar): Free xg_frame_tb_info if present.
6291
7864a3f7
DA
62922012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
6293
6294 Use KSET for write access to Lisp_Object members of struct kboard.
6295 * keyboard.h (KSET): New macro.
6296 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
6297 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
6298 * xterm.c: Adjust users.
6299
4c31be61
DA
63002012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
6301
6302 Use BSET for write access to Lisp_Object members of struct buffer.
6303 * buffer.h (BSET): New macro.
6304 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
6305 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
6306 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
6307 * window.c, xdisp.c, xfns.c: Adjust users.
6308
14ae4239
BT
63092012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
6310
6311 * lread.c (syms_of_lread): Initialize Vlexical_binding.
6312
32bcadb4
JD
63132012-08-11 Jan Djärv <jan.h.d@swipnet.se>
6314
3d29b2ce 6315 * nsterm.m (not_in_argv): New function.
fc0c31f8 6316 (application:openFile, application:openTempFile:):
3d29b2ce
JD
6317 (application:openFileWithoutUI:, application:openFiles:): Open file
6318 if not_in_argv returns non-zero (bug#12171).
6319
32bcadb4 6320 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
6321 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
6322 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
6323 (xg_get_font_name): Use those functions/macros here.
6324 Reported by Frans Oilinki <moilinki@gmail.com>.
6325
9ff9402d 63262012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
6327
6328 * unexmacosx.c (copy_data_segment): Copy initialized data in
6329 statically linked libraries from input file rather than memory.
6330
db74a5fc
YM
6331 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
6332 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
6333 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
6334
25e65510
GM
63352012-08-10 Glenn Morris <rgm@gnu.org>
6336
6337 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
6338 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
6339
7961135c
DA
63402012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
6341
6342 Fix last change to allow compilation with low optimization levels.
6343 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
6344 Reported by Jan Djärv <jan.h.d@swipnet.se>.
6345
42b3a444
DA
63462012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
6347
6348 Use common inline syntax in intervals.h.
6349 * intervals.h (INTERVALS_INLINE): New macro.
6350 Change all users from LISP_INLINE.
6351
9fb0c957
DA
63522012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
6353
6354 Define Qnone once for all platforms.
6355 * frame.c (Qnone): Define here.
6356 (syms_of_frame): DEFSYM it.
6357 * lisp.h (Qnone): New declaration.
6358 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
6359 * xfns.c: Remove duplication. Adjust users.
6360
65e8ee52
DA
63612012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
6362
6363 Remove unused macros from intervals.h.
6364 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
6365 * intervals.c: Adjust comment.
6366
9b855fd6
EZ
63672012-08-10 Eli Zaretskii <eliz@gnu.org>
6368
6369 * w32fns.c <w32_unicode_gui>: New static variable.
6370 (globals_of_w32fns): Initialize it according to os_subtype.
6371 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
6372 testing os_subtype.
6373
39cb9e56 63742012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
6375 Eli Zaretskii <eliz@gnu.org>
6376
6377 Fix bug #10299 with Unicode characters sent by customized
6378 keyboards created by MSKLC.
6379 * w32fns.c (INIT_WINDOW_CLASS): New macro.
6380 (w32_init_class): Use it to initialize the Emacs class with either
6381 ANSI or Unicode API calls.
6382 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
6383 later.
6384 (w32_wnd_proc): If the character code sent by WM_CHAR or
6385 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
6386 original message. Call DefWindowProcW on NT and later.
6387
9374581a
GM
63882012-08-10 Glenn Morris <rgm@gnu.org>
6389
4b94e8cf
GM
6390 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
6391
9374581a
GM
6392 * lisp.h (DIRECTORY_SEP): Let configure set it.
6393
a2752828
DA
63942012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
6395
6396 Use TSET for write access to Lisp_Object slots of struct terminal.
6397 * termhooks.h (TSET): New macro.
6398 * coding.c, terminal.c, xselect.c: Adjust users.
6399
cc92c454
SM
64002012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
6401
6402 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
6403 the failing expression, include them in the error message.
6404 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
6405 * lisp.h (internal_condition_case_n): Update declaration.
6406
4cb3e6b3
DA
64072012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6408
6409 Inline functions to examine and change buffer overlays.
6410 * buffer.c (unchain_both): New function.
6411 * buffer.h (buffer_get_overlays, buffer_set_overlays):
6412 (buffer_has_overlays): New function.
6413 (enum overlay_type): New enum.
6414 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
6415 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
6416
8707c1e5
DA
64172012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6418
6419 Inline functions to examine and change buffer intervals.
6420 * alloc.c (mark_interval_tree): Remove.
6421 (MARK_INTERVAL_TREE): Simplify.
6422 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
6423 * intervals.c (buffer_balance_intervals): New function.
6424 (graft_intervals_into_buffer): Adjust indentation.
6425 (set_intervals_multibyte): Simplify.
6426 * buffer.h (BUF_INTERVALS): Remove.
6427 (buffer_get_intervals, buffer_set_intervals): New function.
6428 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
6429 * intervals.c, textprop.c: Adjust users.
6430
ad8c997f
DA
64312012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6432
6433 Inline functions to examine and change string intervals.
6434 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
6435 (string_get_intervals, string_set_intervals): New function.
6436 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
6437 * lread.c, print.c, textprop.c: Adjust users.
6438
32ac3a6b
GM
64392012-08-08 Glenn Morris <rgm@gnu.org>
6440
6441 * lisp.mk (lisp): Remove language/persian.elc.
6442
77c7bcb1
DA
64432012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6444
6445 Cleanup intervals.
6446 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
6447 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
6448 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
6449 Adjust comment. Move under #if 0.
77c7bcb1
DA
6450 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
6451 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
6452
9c08a8d4
DA
64532012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6454
6455 Check total length of intervals with eassert.
6456 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
6457 * intervals.c: Change all users to eassert.
6458
26d16b35
EZ
64592012-08-07 Eli Zaretskii <eliz@gnu.org>
6460
14ae4239
BT
6461 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
6462 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
6463 INTERNAL_FIELD in Lisp_Cons.
6464
c644523b
DA
64652012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6466
6467 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
6468 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
6469 name since all xname users are fixed long time ago. Do not
6470 use INTERNAL_FIELD.
6471 (set_symbol_name, set_symbol_function, set_symbol_plist):
6472 (set_symbol_next, set_overlay_plist): New function.
6473 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
6474 (struct Lisp_Overlay): Likewise.
6475 (CVAR, MVAR, SVAR): Remove.
6476 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
6477 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
6478 * xterm.c: Adjust users.
6479 * .gdbinit: Change to use name field of struct Lisp_Symbol
6480 where appropriate.
6481
6a3d20cc
DA
64822012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6483
6484 Basic functions to set Lisp_Object and pointer slots of intervals.
6485 * intervals.h (interval_set_parent, interval_set_object):
6486 (interval_set_left, interval_set_right, interval_set_plist):
6487 (interval_copy_parent): New function.
6488 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
6489 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
6490 Adjust indentation.
6a3d20cc
DA
6491 (INTERVAL_SIZE): Remove. Adjust users.
6492 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
6493
4d2b044c
DA
64942012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6495
6496 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
6497 * process.h (PGET): Remove.
6498 (struct Lisp_Process): Do not use INTERNAL_FIELD.
6499 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
6500
d3d50620
DA
65012012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6502
6503 Drop WGET and revert read access to Lisp_Objects slots of struct window.
6504 * window.h (WGET): Remove.
6505 (struct window): Do not use INTERNAL_FIELD.
6506 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6507 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
6508 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
6509 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
6510 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
6511 Adjust users.
6512
d10a51dc
CY
65132012-08-07 Chong Yidong <cyd@gnu.org>
6514
6515 * window.c (Fwindow_edges, Fwindow_pixel_edges)
6516 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
6517 (Fdelete_window_internal): Signal an error if the window is not on
6518 a live frame (Bug#12025).
6519
e69b0960
DA
65202012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6521
6522 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
6523 * frame.h (FGET): Remove.
6524 (struct frame): Do not use INTERNAL_FIELD.
6525 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
6526 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
6527 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
6528 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
6529
25a20a3a
JB
65302012-08-06 Juanma Barranquero <lekktu@gmail.com>
6531
6532 * w32.c: Silence compiler warnings.
6533 (map_w32_filename): Remove unused variable `is_fat'.
6534 (chase_symlinks): Add parentheses around expression.
6535
1c6f11f4
GM
65362012-08-06 Glenn Morris <rgm@gnu.org>
6537
1db4583a
GM
6538 * sysdep.c: Respect BROKEN_GETWD.
6539
1c6f11f4
GM
6540 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
6541 Let configure handle it.
6542 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
6543
2b90362b
DA
65442012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6545
6546 Use GCALIGNMENT where appropriate.
6547 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
6548 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
6549 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
6550
5f50daf2
EZ
65512012-08-06 Eli Zaretskii <eliz@gnu.org>
6552
14ae4239
BT
6553 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
6554 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 6555
cbcc7007
SM
65562012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
6557
6558 * buffer.h (struct buffer): Revert `indirections' to a simple int;
6559 that should be sufficient for everyone.
6560
4d365fa4
JD
65612012-08-06 Jan Djärv <jan.h.d@swipnet.se>
6562
6563 * keyboard.c (timer_check_2): Add break so timer_check returns next
6564 timeout.
6565
dd86bd82
DA
65662012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6567
6568 Fix Windows build errors introduced after converting to WGET and WSET.
6569 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
6570 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
6571
054e1668
JD
65722012-08-06 Jan Djärv <jan.h.d@swipnet.se>
6573
6574 * nsterm.m (ns_frame_rehighlight): Use FSET.
6575
6576 * nsmenu.m (ns_update_menubar): Use FSET.
6577
21238f11
DA
65782012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6579
6580 Separate read and write access to Lisp_Object slots of Lisp_Process.
6581 * process.h (PGET, PSET): New macros similar to AREF and ASET.
6582 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
6583
077288cf
DA
65842012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6585
6586 Separate read and write access to Lisp_Object slots of struct window.
6587 * window.h (WGET, WSET): New macros similar to AREF and ASET.
6588 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6589 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
6590 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
6591 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
6592 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
6593 Adjust users.
6594
71688bd7
DA
65952012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6596
6597 Fix Windows build errors introduced after converting to FGET and FSET.
6598 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
6599 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
6600 (w32_judge_scroll_bars): Change to use FSET.
6601 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
6602
f99bac93
DA
66032012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6604
6605 Fix replacement typo.
6606 * window.c (replace_window): Set root_window instead of
6607 selected_window. This fixes a total window subsystem
6608 malfunction reported by Bastien Guerry <bzg@gnu.org>.
6609
8c2a0f2d
GM
66102012-08-06 Glenn Morris <rgm@gnu.org>
6611
6612 * lisp.mk (lisp): Add language/persian.elc.
6613
edd74c35
DA
66142012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6615
6616 Separate read and write access to Lisp_Object slots of struct frame.
6617 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
6618 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
6619 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
6620 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
6621 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
6622
8671676c
AS
66232012-08-05 Andreas Schwab <schwab@linux-m68k.org>
6624
6625 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
6626
663e2b3f
DA
66272012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
6628
6629 Generalize common compile-time constants.
6630 * lisp.h (header_size, bool_header_size, word_size): Now here.
6631 (struct Lisp_Vector): Add comment.
6632 (struct Lisp_Bool_Vector): Move up to define handy constants.
6633 (VECSIZE, PSEUDOVECSIZE): Simplify.
6634 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
6635 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
6636 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
6637 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
6638 * xfont.c, xmenu.c: Use word_size where appropriate.
6639
d32e47af
LM
66402012-08-05 Lawrence Mitchell <wence@gmx.li>
6641
6642 * search.c (Freplace_match): Treat \? in the replacement text
6643 literally (Bug#8161).
6644
e5d9c0d1
CY
66452012-08-05 Chong Yidong <cyd@gnu.org>
6646
6647 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
6648 * frame.c (Vdelete_frame_functions):
6649 * emacs.c (Vkill_emacs_hook): Doc fix.
6650
8da0576b
EZ
66512012-08-04 Eli Zaretskii <eliz@gnu.org>
6652
6653 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
6654 --with-x-toolkit=no builds.
6655 Reported by Carsten Mattner <carstenmattner@gmail.com>.
6656
02676e5d
CY
66572012-08-04 Chong Yidong <cyd@gnu.org>
6658
6659 * syntax.c (Fmodify_syntax_entry): Doc fix.
6660
97147da9
EZ
66612012-08-04 Eli Zaretskii <eliz@gnu.org>
6662
76151e2c
EZ
6663 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
6664 * w32.c (init_environment): Change the default values of many
6665 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
6666 them into environment when they were not already defined.
6667 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 6668 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
6669 (check_windows_init_file): Now external, not static.
6670 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
6671 called when Vload_path is already set up.
6672
6673 * w32.h (check_windows_init_file): Add prototype.
6674
6675 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
6676 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
6677 compatibility with Posix platforms.
6678 (main): Move the call to check_windows_init_file to here from
6679 w32.c.
6680 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
6681 any, in the DEFALT argument into the root of the Emacs build or
6682 installation tree, as appropriate.
6683
6684 * callproc.c (init_callproc_1): Call decode_env_path instead of
6685 doing its equivalent by hand.
6686 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
6687 the code that sets Vexec_path run on MS-Windows.
6688
6689 * lread.c (init_lread): Add comments to #ifdef's.
6690
97147da9
EZ
6691 * msdos.c (dos_set_window_size, IT_update_begin)
6692 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
6693 instead of direct references.
6694
185ee146
PE
66952012-08-04 Paul Eggert <eggert@cs.ucla.edu>
6696
6697 Export DEFAULT_REHASH_* to GDB.
6698 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
6699 Now constants, not macros.
6700
8834c57a
PE
67012012-08-03 Paul Eggert <eggert@cs.ucla.edu>
6702
98c6f1e3
PE
6703 Remove unnecessary casts involving pointers.
6704 These casts are no longer needed now that we assume C89 or later,
6705 since they involve casting to or from void *.
6706 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
6707 (make_pure_float, make_pure_vector):
6708 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
6709 * macros.c (Fstart_kbd_macro):
6710 * menu.c (find_and_return_menu_selection):
6711 * minibuf.c (read_minibuf_noninteractive):
6712 * sysdep.c (closedir):
6713 * xdisp.c (x_produce_glyphs):
6714 * xfaces.c (compare_fonts_by_sort_order):
6715 * xfns.c (x_real_positions, select_visual):
6716 * xselect.c (x_stop_queuing_selection_requests)
6717 (x_get_window_property, x_get_window_property_as_lisp_data):
6718 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
6719 Remove unnecessary pointer casts.
6720 * alloc.c (record_xmalloc): New function.
6721 * lisp.h (record_xmalloc): New decl.
6722 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
6723 more like a function. This is because the pointer cast is not
6724 needed. All uses changed.
6725 * print.c (print_string, print_error_message): Avoid length recalc.
6726
8834c57a
PE
6727 Improve fix for macroexp crash with debugging (Bug#12118).
6728 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
6729 ARRAY_MARK_FLAG when checking subscripts, because ASET is
6730 not supposed to be invoked from the garbage collector.
6731 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
6732 (gc_aset): New function, which is like ASET but can be
6733 used in the garbage collector.
6734 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
6735 (set_hash_index): Use it instead of ASET.
6736
6dad7178
EZ
67372012-08-03 Eli Zaretskii <eliz@gnu.org>
6738
6739 Support symlinks on latest versions of MS-Windows.
6740 * w32.c: Include winioctl.h and aclapi.h.
6741 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
6742 (revert_to_self): Forward declarations of static functions.
6743 <static BOOL g_b_init_get_security_info>:
6744 <g_b_init_create_symbolic_link>: New static flags.
6745 (globals_of_w32): Initialize them to zero.
6746 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
6747 (map_w32_filename): Improve commentary. Simplify switch.
6748 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
6749 headers (most versions of MinGW w32api don't).
6750 (get_security_info, create_symbolic_link)
6751 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
6752 New functions.
6753 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
6754 in the argument file name.
6755 (sys_access): Call unc_volume_file_attributes only if
6756 GetFileAttributes fails with network-related error codes.
6757 (sys_rename): Diagnose renaming of a symlink when the user doesn't
6758 have the required privileges.
14ae4239 6759 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
6760 get_file_security_desc.
6761 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
6762 with addition of handling of symlinks and support for 'lstat'.
6763 If possible, get file's attributes and security information by
6dad7178
EZ
6764 handle, not by name. Produce S_IFLNK bit for symlinks, when
6765 called from 'lstat'.
6766 (stat, lstat): New functions, call 'stat_worker'.
6767 (symlink, readlink, careadlinkat): Rewritten to create and resolve
6768 symlinks when the underlying filesystem supports them.
6769
f162bcc3
PE
67702012-08-02 Paul Eggert <eggert@cs.ucla.edu>
6771
79ea6c20
PE
6772 Fix macroexp crash on Windows with debugging (Bug#12118).
6773 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
6774 checking subscripts; problem introduced with the recent
6775 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
6776 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
6777 since it's used in non-static inline functions now.
6778
c0ce93fd
PE
6779 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
6780 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 6781
f162bcc3
PE
6782 Use C99-style 'extern inline' if available.
6783 * buffer.h (BUFFER_INLINE):
6784 * category.h (CATEGORY_INLINE):
6785 * character.h (CHARACTER_INLINE):
6786 * charset.h (CHARSET_INLINE):
6787 * composite.h (COMPOSITE_INLINE):
6788 * dispextern.h (DISPEXTERN_INLINE):
6789 * lisp.h (LISP_INLINE):
6790 * systime.h (SYSTIME_INLINE):
6791 New macro, replacing 'static inline' in this header.
6792 * buffer.h, category.h, character.h, charset.h, composite.h:
6793 * dispextern.h, lisp.h, systime.h:
6794 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6795 * alloc.c (LISP_INLINE):
6796 * buffer.c (BUFFER_INLINE):
6797 * category.c (CATEGORY_INLINE):
6798 * character.c (CHARACTER_INLINE):
6799 * charset.c (CHARSET_INLINE):
6800 * composite.c (COMPOSITE_INLINE):
6801 * dispnew.c (DISPEXTERN_INLINE):
6802 * sysdep.c (SYSTIME_INLINE):
6803 Define to EXTERN_INLINE, so that the corresponding functions
6804 are compiled into code.
6805 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
6806 (INLINE_HEADER_END): New macros.
6807 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
6808 since it's used in non-static inline functions now.
a8333d03 6809 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 6810
837b365b
GM
68112012-08-02 Glenn Morris <rgm@gnu.org>
6812
d66b744d
GM
6813 * s/: Remove empty directory.
6814
837b365b
GM
6815 * s/ms-w32.h: Move to ../nt/inc.
6816 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
6817 Update for new ms-w32.h location.
6818
13294f95
PE
68192012-08-02 Paul Eggert <eggert@cs.ucla.edu>
6820
6821 Port to Solaris 8.
6822 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
6823
90df0db3
GM
68242012-08-02 Glenn Morris <rgm@gnu.org>
6825
6826 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
6827 hard-coding the path separator.
6828
4939150c
PE
68292012-08-01 Paul Eggert <eggert@cs.ucla.edu>
6830
6831 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
6832 This how ASET and AREF are supposed to work, and makes
6833 it easier to think about future improvements. See
6834 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
6835 * charset.h (set_charset_attr): New function.
6836 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
6837 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
6838 (aref_addr): New function. All uses of &AREF(...) changed.
6839 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
6840 (set_hash_index): New functions. All lvalue-style uses of
6841 HASH_KEY etc. changed.
6842 * keyboard.c (set_prop): New function. All lvalue-style uses
6843 of PROP changed.
6844
947b2afd
AA
68452012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
6846
6847 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
6848 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 6849 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
6850 * nsfns.m (ns_set_name_as_filename): Likewise.
6851 * nsmenu.m (ns_update_menubar): Likewise.
6852 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
6853
4f5d0325
EZ
68542012-08-01 Eli Zaretskii <eliz@gnu.org>
6855
2008beae
EZ
6856 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
6857 Adapt to latest changes in field names of the corresponding Lisp
288479f6 6858 objects.
2008beae 6859
4f5d0325
EZ
6860 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
6861
fe3cc771
GM
68622012-08-01 Glenn Morris <rgm@gnu.org>
6863
6864 * s/msdos.h: Remove file.
6865 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
6866 * Makefile.in (S_FILE): Remove.
6867 (config_h): Remove S_FILE.
6868
c90acc54
JB
68692012-08-01 Juanma Barranquero <lekktu@gmail.com>
6870
6871 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
6872 Remove; moved to nt/config.nt.
6873
d8a05828
DA
68742012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6875
6876 Use INTERNAL_FIELD for conses and overlays.
6877 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
6878 Remove obsolete comment.
6879 (MVAR): New macro.
6880 (struct Lisp_Overlay): Use INTERNAL_FIELD.
6881 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
6882
8271d590
DA
68832012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6884
6885 Use INTERNAL_FIELD for symbols.
6886 * lisp.h (SVAR): New macro. Adjust users.
6887 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
6888 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
6889
3193acd2
DA
68902012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6891
6892 Use INTERNAL_FIELD for processes.
6893 * process.h (PVAR): New macro. Adjust style.
6894 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
6895 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
6896
3a45383a
DA
68972012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6898
6899 Use INTERNAL_FIELD for windows.
6900 * window.h (WVAR): New macro.
6901 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
6902 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6903 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
6904 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
6905 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
6906 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
6907
c1dbc63c
PE
69082012-08-01 Paul Eggert <eggert@cs.ucla.edu>
6909
6910 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
6911
5c0c0e8a
GM
69122012-08-01 Glenn Morris <rgm@gnu.org>
6913
6914 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
6915 Move to configure.ac.
6916
552a99b4
JB
69172012-08-01 Juanma Barranquero <lekktu@gmail.com>
6918
6919 * makefile.w32-in (CONFIG_H): Update dependencies.
6920 (CONF_POST_H): New macro.
6921
6922 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
6923
8d8e2dfe
GM
69242012-07-31 Glenn Morris <rgm@gnu.org>
6925
bc96620a
GM
6926 * Makefile.in (S_FILE): No longer set by configure.
6927
476b1b2d
GM
6928 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
6929 is available.
6930 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
6931
b2c7a106
GM
6932 * process.h (NULL_DEVICE):
6933 * emacs.c (SEPCHAR):
6934 * editfns.c (USER_FULL_NAME): Let configure set them.
6935
d53d062a
GM
6936 * s/README, s/template.h: Remove files.
6937
4515017f
GM
6938 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
6939
8d8e2dfe
GM
6940 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
6941 Move to configure.ac.
6942
5b20b3cc
EZ
69432012-07-31 Eli Zaretskii <eliz@gnu.org>
6944
1e0afd9a
EZ
6945 * .gdbinit (xframe): Adapt to introduction of FVAR and the
6946 resulting renaming of 'struct frame' members.
6947
5b20b3cc
EZ
6948 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
6949
6950 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
6951 after introduction of FVAR.
6952
f1310128
JD
69532012-07-31 Jan Djärv <jan.h.d@swipnet.se>
6954
79e721e0
JD
6955 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
6956
6957 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
6958 instead of compositeToPoint.
6959 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
6960
8d7c7eed 6961 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 6962
e34f7f79
DA
69632012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
6964
6965 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
6966 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 6967 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
6968 (BVAR): Change to use INTERNAL_FIELD.
6969 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
6970 (KVAR): Change to use INTERNAL_FIELD.
6971 * frame.h (FVAR): New macro.
6972 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
6973 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
6974 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
6975 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
6976 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
6977
c09bfb2f
DA
69782012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
6979
6980 Miscellaneous fixes for non-default X toolkits.
6981 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
6982 * xterm.c (x_frame_of_widget): Remove redundant prototype.
6983 Move under #ifdef USE_LUCID.
6984 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
6985 definition and usage to avoid warnings.
6986
14c114ae
JD
69872012-07-31 Jan Djärv <jan.h.d@swipnet.se>
6988
6989 * nsterm.m (openFiles): Fix previous checkin.
6990
3bd21e82
PE
69912012-07-31 Paul Eggert <eggert@cs.ucla.edu>
6992
6993 * indent.c (compute_motion): Remove unused local.
6994
c1529ded
GM
69952012-07-31 Glenn Morris <rgm@gnu.org>
6996
400d5621
GM
6997 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
6998
268e2432
GM
6999 * conf_post.h [USG5_4]:
7000 Move remaining contents of s/usg5-4-common.h here.
7001 * s/usg5-4-common.h: Remove file.
7002
7552f3ee
GM
7003 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
7004 * s/irix6-5.h: Remove file.
7005
6a381852
GM
7006 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
7007 * s/darwin.h: Remove file.
7008
c1529ded
GM
7009 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
7010 * s/hpux10-20.h: Remove file, which is now empty.
7011
b429a4ee
GM
70122012-07-30 Glenn Morris <rgm@gnu.org>
7013
7014 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
7015 * Makefile.in (config_h): Add conf_post.h.
7016 * makefile.w32-in (CONFIG_H): Add conf_post.h.
7017
adff3182
JD
70182012-07-30 Jan Djärv <jan.h.d@swipnet.se>
7019
7020 * nsterm.m (ns_do_open_file): New variable.
b9031d69 7021 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
7022 (openFile, openTempFile, openFileWithoutUI, openFiles):
7023 Open files only if ns_do_open_file.
adff3182 7024
c32af1e4
PE
70252012-07-30 Paul Eggert <eggert@cs.ucla.edu>
7026
7393bcbb
PE
7027 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
7028 This no-op macro hasn't been needed for many years.
7029 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
7030
c32af1e4
PE
7031 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
7032 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
7033 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
7034 gdb_make_enums_visible.
7035 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
7036 (DIRECTORY_SEP): Now a constant, not a macro.
7037
302fc036
EZ
70382012-07-30 Eli Zaretskii <eliz@gnu.org>
7039
7040 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
7041 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
7042
7043 * w32term.c <w32_keyboard_codepage>: Renamed from
7044 keyboard_codepage and now external. All users changed.
7045
7046 * w32term.h: Add declaration of w32_keyboard_codepage.
7047
7048 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
7049 the codepage to translate keys to Unicode. If this argument is
7050 -1, use the value returned by GetConsoleCP. All callers changed.
7051
88fb40b4
PE
70522012-07-30 Paul Eggert <eggert@cs.ucla.edu>
7053
0aee6912
PE
7054 Update .PHONY listings in makefiles.
7055 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
7056 bootstrap-clean, distclean, maintainer-clean, versioclean,
7057 extraclean, frc.
7058
88fb40b4
PE
7059 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
7060 This is a bit clearer. Fix some commentary typos.
7061
0a763bd1
GM
70622012-07-30 Glenn Morris <rgm@gnu.org>
7063
32bac6d6
GM
7064 * s/netbsd.h: Let configure include signal.h if needed.
7065 Remove file, which is now empty.
7066
b65e7c46
GM
7067 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
7068 Let configure set them.
7069 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
7070 No more need to undefine.
0a763bd1 7071
169304bd
AS
70722012-07-30 Andreas Schwab <schwab@linux-m68k.org>
7073
7074 * keymap.c (Fkey_description): Don't remove 0x80 bit from
7075 non-single-byte char when adding meta modifier. (Bug#12090)
7076
6cd7a139
DA
70772012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
7078
7079 Convert safe_call to use variable number of arguments.
7080 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
7081 (safe_call2): Fix comment.
7082 * lisp.h (safe_call): Adjust prototype.
7083 * coding.c (encode_coding_object): Change to use safe_call2.
7084 * xfaces.c (merge_face_heights): Change to use safe_call1.
7085
d34d6ffc
GM
70862012-07-30 Glenn Morris <rgm@gnu.org>
7087
7b8a48e4 7088 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 7089 does that unconditionally. Remove file, which is now empty.
7b8a48e4 7090
d34d6ffc
GM
7091 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
7092 Remove empty files.
7093
03a660a6
PE
70942012-07-30 Paul Eggert <eggert@cs.ucla.edu>
7095
7096 Export to GDB most of lisp.h's remaining object-like macros.
7097 * lisp.h (min, max): Move earlier, because they're used earlier now.
7098 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
7099 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
7100 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
7101 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
7102 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
7103 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
7104 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
7105 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
7106 Now constants, for GDB. They need not be macros.
7107 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
7108 Now constants, for GDB, as well as macros, for static initializers.
7109 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
7110 Move to after the definition of struct Lisp_Char_Table,
7111 since the former now needs that type defined.
7112 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
7113 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
7114 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
7115 New enums, for gdb_make_enums_visible.
7116 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 7117 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
7118 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
7119 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
7120 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
7121 enum maxargs, enum MAX_ALLOCA.
7122 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
7123 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
7124 no longer needed, now that they are done in lisp.h.
7125
e499d0ee
DA
71262012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
7127
7128 Cleanup string bytes checking.
7129 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
7130 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
7131 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
7132 (check_sblock, compact_small_strings): Simplify.
7133
d5040d2d
PE
71342012-07-29 Paul Eggert <eggert@cs.ucla.edu>
7135
7136 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
7137 These macros are confusing and no longer need to be defined, as
7138 the enum values now suffice. All uses replaced with definiens.
7139 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
7140
7f259ae6
JB
71412012-07-29 Juanma Barranquero <lekktu@gmail.com>
7142
7143 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
7144 ($(BLD)/w32console.$(O)): Update dependencies.
7145
7e63e0c3
DA
71462012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
7147
7148 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
7149 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
7150 time. Adjust users.
7151 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
7152
ffd817eb
JD
71532012-07-29 Jan Djärv <jan.h.d@swipnet.se>
7154
7155 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
7156 setting sitelisp (Bug#12010).
7157
417a7a0e
EZ
71582012-07-29 Eli Zaretskii <eliz@gnu.org>
7159
14ae4239 7160 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
7161
7162 * w32heap.c (cache_system_info):
7163 * w32.c (sys_rename):
7164 * w32proc.c (find_child_console, sys_kill): All users changed.
7165
387d4d92
PE
71662012-07-29 Paul Eggert <eggert@cs.ucla.edu>
7167
7168 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
7169
55a6cca6
EZ
71702012-07-29 Eli Zaretskii <eliz@gnu.org>
7171
7172 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
7173
dbcf001c
DA
71742012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
7175
7176 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
7177 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
7178 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 7179
e2688e4a
DA
71802012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
7181
7182 Generalize marker debugging code under MARKER_DEBUG and use eassert.
7183 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
7184 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
7185 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
7186 (replace_range, replace_range_2, del_range_2): Change to eassert.
7187 * marker.c (byte_char_debug_check): Adjust style.
7188
b46a6a83
PE
71892012-07-29 Paul Eggert <eggert@cs.ucla.edu>
7190
7191 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
7192 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
7193 long-ago-commented-out code that talks about "WIN32".
7194 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
7195 All uses changed.
7196
e32a5799
PE
71972012-07-28 Paul Eggert <eggert@cs.ucla.edu>
7198
7199 Use Gnulib stdalign module (Bug#9772, Bug#9960).
7200 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
7201 Simplify by using alignof.
7202 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
7203 * lisp.h: Include <stdalign.h>.
7204 (GCALIGNMENT): New macro and constant.
7205 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
7206 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
7207 (stdalign): New macro, if not already defined.
7208
df81cd29
EZ
72092012-07-28 Eli Zaretskii <eliz@gnu.org>
7210
01bd1b0d
EZ
7211 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
7212 * w32inevt.c: Include w32inevt.h.
7213 (w32_read_console_input): New inline function, calls either
7214 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
7215 w32_console_unicode_input.
7216 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
7217 (w32_kbd_patch_key, key_event): Use the codepage returned by
7218 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
7219 (key_event): use uChar.UnicodeChar only if
7220 w32_console_unicode_input is non-zero.
7221
7222 * w32console.c: Include w32heap.h.
7223 <w32_console_unicode_input>: New global variable.
7224 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
7225 family of Windows, zero otherwise.
7226
7227 * w32inevt.h: Declare w32_console_unicode_input.
7228
df81cd29
EZ
7229 * xdisp.c (init_iterator): Don't reference tip_frame in a build
7230 --without-x. (Bug#11742)
7231
c20fdd9e
PE
72322012-07-27 Paul Eggert <eggert@cs.ucla.edu>
7233
7234 Adjust GDB to reflect pvec_type changes (Bug#12036).
7235 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
7236 2012-07-04 changes to pseudovector representation.
7237 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 7238
32770973 72392012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
7240
7241 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
7242 bus address.
7243 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
7244
3438fe21
EZ
72452012-07-27 Eli Zaretskii <eliz@gnu.org>
7246
bcfbc9de
EZ
7247 * alloc.c (listn): Fix the order the arguments are consed onto the
7248 list.
7249
3438fe21
EZ
7250 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
7251 enumeration constants, as PURE and HEAP are too general, and clash
7252 with other headers and sources, such as gmalloc.c and the
7253 MS-Windows system headers. All users changed.
7254
eeaea515
DA
72552012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
7256
7257 Revert last save_excursion_save and save_excursion_restore changes.
7258 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
7259 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
7260
073c88c2
DA
72612012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
7262
7263 Fix recently-introduced typos in Windows port.
7264 Reported by Martin Rudalics <rudalics@gmx.at>.
7265 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 7266 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 7267
4706125e
PE
72682012-07-27 Paul Eggert <eggert@cs.ucla.edu>
7269
7270 Improve GDB symbol export (Bug#12036).
7271 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
7272 arms of an 'if', not using conditional expressions; otherwise GDB
7273 complains about the types in the unevaluated arm when the argument
7274 is an integer literal.
7275 (xgetint): Simplify expression.
7276 * alloc.c (gdb_make_enums_visible): New constant. This ports to
7277 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
7278 Zaretskii in <http://bugs.gnu.org/12036#13>.
7279 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
7280 needed now that we have gdb_make_enums_visible.
7281 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
7282 (enum enum_USE_LSB_TAG):
7283 New enum types, packaging up enums that need to be exported to GDB.
7284
694b6c97
DA
72852012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
7286
7287 Utility function to make a list from specified amount of objects.
7288 * lisp.h (enum constype): New datatype.
7289 (listn): New prototype.
7290 * alloc.c (listn): New function.
7291 (Fmemory_use_count, syms_of_alloc): Use it.
7292 * buffer.c (syms_of_buffer): Likewise.
7293 * callint.c (syms_of_callint): Likewise.
7294 * charset.c (define_charset_internal): Likewise.
7295 * coding.c (syms_of_coding): Likewise.
7296 * keymap.c (syms_of_keymap): Likewise.
7297 * search.c (syms_of_search): Likewise.
7298 * syntax.c (syms_of_syntax): Likewise.
7299 * w32.c (init_environment): Likewise.
7300 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
7301 * xdisp.c (syms_of_xdisp): Likewise.
7302 * xfns.c (syms_of_xfns): Likewise.
7303
6195f384
DA
73042012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
7305
7306 Fast save_excursion_save and save_excursion_restore.
7307 * lisp.h (struct Lisp_Excursion): New data type.
7308 (PVEC_EXCURSION): New pseudovector type.
7309 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
7310 to deal with it. Adjust comments.
7311 (init_marker, attach_marker): New prototype.
7312 (unchain_marker): Adjust prototype.
7313 * marker.c (attach_marker): Change to global.
7314 (init_marker): New function.
7315 * alloc.c (Fmake_marker, build_marker): Use it.
7316 (build_marker): More easserts.
7317 (mark_object): Handle struct Lisp_Excursion.
7318 * editfns.c (save_excursion_save, save_excursion_restore):
7319 Reimplement to use struct Lisp_Excursion. Add comments.
7320
5eceb8fb
PE
73212012-07-26 Paul Eggert <eggert@cs.ucla.edu>
7322
7323 Fix export of symbols to GDB (Bug#12036).
7324 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
7325 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
7326 emacs.c, as this is a more-suitable home. Had this been done earlier
7327 the fix for 12036 would have avoided some of the problems noted in
7328 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
7329 would have been more obvious.
562157c8
PE
7330 * emacs.c: Do not include <verify.h>; no longer needed.
7331 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
7332 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
7333 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
7334 Remove; now done in lisp.h.
7335 * lisp.h (PUBLISH_TO_GDB): New macro.
7336 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
7337 (DATA_SEG_BITS): Use it.
7338 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
7339 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
7340 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
7341 not be usable in #if. This simplifies things.
7342
d6749401
JB
73432012-07-26 Juanma Barranquero <lekktu@gmail.com>
7344
7345 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
7346
1781b9e9
PE
73472012-07-26 Paul Eggert <eggert@cs.ucla.edu>
7348
d89518db 7349 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
7350 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
7351 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
7352 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
7353 Adjust to changes in lisp.h and emacs.c, by using
7354 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
7355 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
7356 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
7357 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
7358 instead of gdb_valbits.
7359 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
7360 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
7361 instead of gdb_array_mark_flag.
7362 (xboolvector): Get size from $->size, not $->header.size.
7363 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
7364 (xreload, hook-run, hookpost-run): Remove.
7365 * emacs.c: Include <verify.h>.
7366 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
7367 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
7368 Remove.
7369 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
7370 (gdb_USE_LSB_TAG): New enum constants.
7371 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
7372 Also define these as enum constants, so they're visible to GDB.
7373 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
7374 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
7375 as constants, so they're visible to GDB.
7376 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
7377 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
7378 Now enum constants, not macros, so they're visible to GDB.
7379 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
7380 more convenient now. All uses changed.
7381 (VALMASK) [USE_LSB_TAG]: Also define in this case.
7382 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
7383
3628596a
DA
73842012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
7385
7386 Explicitly free restriction data that are not needed anymore.
7387 * editfns.c (save_restriction_restore): Free restriction data.
7388
7abaf5cc
SM
73892012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
7390
7391 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
7392 add argument, tune behavior, and adjust all callers.
7393
71f88e00
PE
73942012-07-25 Paul Eggert <eggert@cs.ucla.edu>
7395
7396 Use typedef for EMACS_INT, EMACS_UINT.
7397 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
7398 than macros. This simplifies debugging in the usual case, since
7399 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
7400 and it allows expressions involving EMACS_INT casts.
7401 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
7402
57ec3034
JD
74032012-07-25 Jan Djärv <jan.h.d@swipnet.se>
7404
7405 * nsterm.m (ns_read_socket): Return early if there is a modal
7406 window (Bug#12043).
7407
8137e7b3
MR
74082012-07-25 Martin Rudalics <rudalics@gmx.at>
7409
7410 * frame.c (Fredirect_frame_focus): In doc-string don't mention
7411 that FOCUS-FRAME can be omitted.
7412
04e9897c
DA
74132012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
7414
7415 Adjust buffer text indirection counters at the end of Fkill_buffer.
7416 * buffer.c (Fkill_buffer): Adjust indirection counters when the
7417 buffer is definitely dead. This should really fix an issue reported
7418 by Christoph Scholtes again. (Bug#12007).
7419 (init_buffer_once): Initialize indirection counters of
7420 buffer_defaults and buffer_local_symbols (for sanity and safety).
7421
8a0484e1
EZ
74222012-07-24 Eli Zaretskii <eliz@gnu.org>
7423
7424 * xdisp.c (init_iterator): Don't compute dimensions of truncation
7425 and continuation glyphs on tooltip frames, leave them at zero.
7426 Avoids continued lines in tooltips. (Bug#11832)
7427
fa691a83
DA
74282012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
7429
7430 Simplify copy_overlay.
04e9897c 7431 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
7432 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
7433
436bc8e0
EZ
74342012-07-23 Eli Zaretskii <eliz@gnu.org>
7435
7436 * print.c (print_object): Don't crash when a frame's name is nil
7437 or invalid. (Bug#12025)
7438
7439 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
7440 it signals an error when a tooltip frame is being created.
7441
d7a7fda3
DA
74422012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
7443
7444 Cleanup miscellaneous objects allocation and initialization.
7445 * alloc.c (allocate_misc): Change to static. Add argument to
7446 specify the subtype. Adjust comment and users.
7447 (build_overlay): New function.
7448 * buffer.c (copy_overlays, Fmake_overlay): Use it.
7449 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
7450 (allocate_misc): Remove prototype.
7451 (build_overlay): Add prototype.
7452
74532012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
7454
7455 Swap buffer text indirection counters in Fbuffer_swap_text.
7456 * buffer.c (Fbuffer_swap_text): Swap indirections too.
7457 This avoids crash reported by Christoph Scholtes at
7458 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
7459
9d7fa573
JD
74602012-07-22 Jan Djärv <jan.h.d@swipnet.se>
7461
7462 * nsmenu.m (Popdown_data): New struct.
7463 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
7464 free Popdown_data.
7465 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
7466 (initWithContentRect): Make imgView and contentView non-static
7467 and autorelease them. Also autorelease img and matrix (Bug#12005).
7468 (dealloc): Remove (Bug#12005).
7469
0dd6d66d
DA
74702012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
7471
7472 Adjust consing_since_gc when objects are explicitly freed.
7473 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
7474 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
7475 (free_cons, free_misc): Subtract object size from consing_since_gc.
7476
d36d71df
DA
74772012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
7478
7479 Simplify and cleanup markers positioning code.
7480 * marker.c (attach_marker): More useful eassert.
7481 (live_buffer, set_marker_internal): New function.
7482 (Fset_marker, set_marker_restricted): Use set_marker_internal.
7483 (set_marker_both, set_marker_restricted_both): Use live_buffer.
7484
fb9ea40f
PE
74852012-07-22 Paul Eggert <eggert@cs.ucla.edu>
7486
7487 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
7488 as it's limited by the amount of memory, not by INT_MAX.
7489
2d5c5f7d
EZ
74902012-07-21 Eli Zaretskii <eliz@gnu.org>
7491
07fb592e
EZ
7492 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
7493 in special-event-map. See the discussion at
7494 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
7495 for the reasons.
7496
37a9eac8 7497 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
7498 info.dwItemData. Fixes crashes on 64-bit Windows.
7499 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 7500
c4328746
JD
75012012-07-21 Jan Djärv <jan.h.d@swipnet.se>
7502
fc0c31f8 7503 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 7504 (conversationIdentifier): Return value is NSInteger.
784051c4 7505 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 7506
6e5d1c12
CY
75072012-07-21 Chong Yidong <cyd@gnu.org>
7508
7509 * window.c (decode_any_window): Signal an error if the window is
7510 on a dead frame (Bug#11984).
7511
9928463d
DA
75122012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7513
7514 Add indirection counting to speed up Fkill_buffer.
7515 * buffer.h (struct buffer): New member.
7516 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
7517 (Fmake_indirect_buffer): Set indirection counter to -1, increment
7518 base buffer indirection counter.
7519 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
7520 (Fkill_buffer): Adjust indirection counters as needed, don't walk
7521 through buffer list if indirection counter is 0.
7522
f8643a6b
DA
75232012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7524
7525 Extend the value returned by Fgarbage_collect with heap statistics.
7526 * alloc.c (Qheap): New symbol.
7527 (syms_of_alloc): DEFSYM it.
7528 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
7529 (Fmemory_free): Remove.
7530 (syms_of_alloc): Don't defsubr it.
7531 * buffer.c (Fcompact_buffer): Remove.
7532 (syms_of_buffer): Don't defsubr it.
7533
dac616ff
DA
75342012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7535
7536 Make maybe_gc inline.
7537 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
7538 * lisp.h (consing_since_gc, gc_relative_threshold)
7539 (memory_full_cons_threshold): Revert declaration.
7540 (maybe_gc): Remove prototype, define as inline.
7541 * alloc.c: Remove old commented-out code.
7542 (consing_since_gc, gc_relative_threshold)
7543 (memory_full_cons_threshold): Revert to global.
7544 (maybe_gc): Remove.
7545
d7ea76b4
DA
75462012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7547
7548 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
7549 * lisp.h (build_unibyte_string): New function.
7550 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
7551 * sysdep.c, w32fns.c, xfns.c: Use it.
7552 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
7553 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
7554 Adjust users accordingly.
7555 * font.h (font_open_by_name): Adjust prototype.
7556
765e61e3
DA
75572012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7558
7559 Cleanup calls to Fgarbage_collect.
7560 * lisp.h (maybe_gc): New prototype.
7561 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
7562 Remove declarations.
7563 * alloc.c (maybe_gc): New function.
7564 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
7565 Make them static.
7566 * bytecode.c (MAYBE_GC): Use maybe_gc.
7567 * eval.c (eval_sub, Ffuncall): Likewise.
7568 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
7569 to avoid dependency from auto-save feature.
7570
52b852c7
PE
75712012-07-19 Paul Eggert <eggert@cs.ucla.edu>
7572
7573 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
7574 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
7575 'for_each_per_buffer_object_at'.
7576 All uses changed. It's better to use upper-case for macros that
7577 cannot be implemented as functions, to give the reader a clue
7578 that they're special.
7579
5db81e33
SM
75802012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
7581
7582 * alloc.c (Fgarbage_collect): Tweak docstring.
7583
5b835e1d
DA
75842012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
7585
7586 Tweak the value returned from Fgarbage_collect again.
7587 * alloc.c (Fgarbage_collect): New return value, as confirmed in
7588 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
7589 Adjust documentation.
7590 (total_vector_bytes): Rename to total_vector_slots, adjust
7591 accounting.
7592 (total_free_vector_bytes): Rename to total_free_vector_slots,
7593 adjust accounting.
7594 (Qstring_bytes, Qvector_slots): New symbols.
7595 (syms_of_alloc): DEFSYM them.
7596
9cd47b72
DA
75972012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
7598
7599 Buffer compaction primitive which may be used from Lisp.
7600 * buffer.c (compact_buffer, Fcompact_buffer): New function.
7601 (syms_of_buffer): Register Fcompact_buffer.
7602 * alloc.c (Fgarbage_collect): Use compact_buffer.
7603 * buffer.h (compact_buffer): New prototype.
7604 (struct buffer_text): New member.
7605
d17337e5
DA
76062012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
7607
7608 New macro to iterate over all buffers, miscellaneous cleanups.
7609 * lisp.h (all_buffers): Remove declaration.
7610 * buffer.h (all_buffers): Add declaration, with comment.
7611 (for_each_buffer): New macro.
7612 * alloc.c (Fgarbage_collect, mark_object): Use it.
7613 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
7614 (init_buffer): Likewise.
7615 * data.c (Fset_default): Likewise.
7616 * coding.c (code_conversion_restore): Remove redundant check
7617 for dead buffer.
7618 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
7619
60cfd278
AS
76202012-07-18 Andreas Schwab <schwab@linux-m68k.org>
7621
7622 Fix bug that created negative-length intervals.
7623 * intervals.c (merge_interval_right, merge_interval_left):
7624 Do not zero out this interval if it is absorbed by its children,
7625 as this interval's total length doesn't change in that case. See
7626 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
7627
d06714cb
PE
76282012-07-18 Paul Eggert <eggert@cs.ucla.edu>
7629
83713154
PE
7630 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
7631 when invoking (make-bool-vector N t) and N is a positive
7632 multiple of 8 -- the last 8 bits were mistakenly cleared.
7633
d06714cb
PE
7634 Remove some struct layout assumptions in bool vectors.
7635 * alloc.c (bool_header_size): New constant.
7636 (header_size, word_size): Move earlier, as they're now used earlier.
7637 Use 'word_size' in a few more places, where it's appropriate.
7638 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
7639 padding before the data member of a bool vector.
7640 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
7641 than doing the check by hand with an abort ().
7642
464d5a5e
SM
76432012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
7644
5fbc0409
SM
7645 * eval.c (Fdefvar): Don't check constants since we only set the var if
7646 it's not yet defined anyway (bug#11904).
7647
464d5a5e
SM
7648 * lisp.h (last_undo_boundary): Declare new var.
7649 * keyboard.c (command_loop_1): Set it.
7650 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
7651 were auto-added by the command loop (bug#11774).
7652
8dc2e44a
AS
76532012-07-18 Andreas Schwab <schwab@linux-m68k.org>
7654
7655 * w32font.c (Qsymbol): Remove local definition.
7656 (syms_of_w32font): Don't DEFSYM it.
7657
169925ec
DA
76582012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
7659
7660 Fix sweep_vectors to handle large bool vectors correctly.
7661 * alloc.c (sweep_vectors): Account total_vector_bytes for
7662 bool vectors larger than VBLOCK_BYTES_MAX.
7663
5fbfb018
CY
76642012-07-18 Chong Yidong <cyd@gnu.org>
7665
7666 * frame.c (x_set_frame_parameters): Revert bogus change introduced
7667 in 2012-05-25 commit by Paul Eggert (Bug#11738).
7668
3ab6e069
DA
76692012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
7670
7671 Return more descriptive data from Fgarbage_collect.
7672 Suggested by Stefan Monnier in
7673 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
7674 * alloc.c (bounded_number): New function.
7675 (total_buffers, total_vectors): New variable.
7676 (total_string_size): Rename to total_string_bytes, adjust users.
7677 (total_vector_size): Rename to total_vector_bytes, adjust users.
7678 (sweep_vectors): Account total_vectors and total_vector_bytes.
7679 (Fgarbage_collect): New return value. Adjust documentation.
7680 (gc_sweep): Account total_buffers.
7681 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
7682 (VECTOR_SIZE): Remove.
7683 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
7684 (Qinterval, Qmisc): New symbols.
7685 (syms_of_data): Initialize them.
7686 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
7687 (Qcons, Qbuffer): New declarations.
7688
6d02fe5b
PE
76892012-07-17 Paul Eggert <eggert@cs.ucla.edu>
7690
7691 * alloc.c (Fmemory_free): Account for memory-free's own storage.
7692 Round up, not down. Improve doc.
7693
b7ffe040
DA
76942012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7695
7696 Restore old code in allocate_string_data to avoid Faset breakage.
7697 Reported by Julien Danjou <julien@danjou.info> in
7698 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
7699 * alloc.c (allocate_string_data): Restore old code with minor
7700 adjustments, fix comment to explain this subtle issue.
7701
4dc7c8d5
SM
77022012-07-17 Eli Zaretskii <eliz@gnu.org>
7703
7704 Remove FILE_SYSTEM_CASE.
7705 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
7706
7707 * fileio.c (FILE_SYSTEM_CASE): Don't define.
7708 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
7709 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
7710 call-process-region passes it through expand-file-name.
7711
7712 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
7713
77142012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7715
7716 Fix crash when creating indirect buffer (Bug#11917)
7717 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
7718 Don't handle unbound variables specially if non-zero.
7719 (Fbuffer_local_variables): Pass zero.
7720 (clone_per_buffer_values): Pass non-zero.
7721
77222012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7723
7724 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
7725 to make the loop interruptible.
7726
77272012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7728
7729 * gnutls.c (emacs_gnutls_handshake): Only retry if
7730 GNUTLS_E_INTERRUPTED.
7731
cce7fefc
DA
77322012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7733
7734 Cleanup and convert miscellaneous checks to eassert.
7735 * alloc.c (mark_interval): Fix comment, partially rephrase
7736 old comment from intervals.h (see below).
7737 * intervals.c (find_interval, adjust_intervals_for_insertion)
7738 (delete_interval, adjust_intervals_for_deletion)
7739 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
7740 Convert to eassert.
7741 (adjust_intervals_for_insertion, make_new_interval):
7742 Remove obsolete and unused code.
7743 * intervals.h (struct interval): Remove obsolete comment.
7744 * textprotp.c (erase_properties): Remove unused code.
7745 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
7746 (Fremove_list_of_text_properties): Convert to eassert.
7747
9ea10cc3
CY
77482012-07-17 Chong Yidong <cyd@gnu.org>
7749
7750 * editfns.c (Finsert_char): Doc fix.
7751
3900d5de
DA
77522012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7753
7754 Fix previous change to make Fmemory_free always accurate.
7755 * alloc.c (make_interval): Update total_free_intervals.
7756 (make_float): Likewise for total_free_floats.
7757 (free_cons, Fcons): Likewise for total_free_conses.
7758 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
7759 Likewise for total_free_vector_bytes.
7760 (Fmake_symbol): Likewise for total_free_symbols.
7761 (bytes_free): Remove.
7762
7098646f
DA
77632012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7764
7765 Simple free memory accounting feature.
7766 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
7767 (sweep_vectors): Accumulate size of free vectors.
7768 (Fgarbage_collect): Setup bytes_free.
7769 (Fmemory_free): New function.
7770 (syms_of_alloc): Register it.
7771
22657b40
DA
77722012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7773
7774 Cleanup overlays checking.
7775 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
7776 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
7777 eassert and OVERLAYP.
7778 (sort_overlays): Change to use OVERLAYP.
7779
ddfc8813
RK
77802012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
7781
7782 * editfns.c (Finsert_char): Make it interactive, and make the
7783 second arg optional. Copy interactive spec and docstring from
7784 ucs-insert.
7785
7c26cf3c
PE
77862012-07-17 Paul Eggert <eggert@cs.ucla.edu>
7787
7788 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
7789 Unlike the other wrapped functions, fabs has an unspecified
7790 effect on errno.
7791
5d127af9
JD
77922012-07-16 Jan Djärv <jan.h.d@swipnet.se>
7793
7794 * nsterm.m (keyDown): Interpret flags without left/right bits
7795 as the left key (Bug#11670).
7796
6a0dd1d7
DA
77972012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
7798
7799 Remove empty and useless init functions.
7800 * lisp.h (init_character_once, init_fns, init_image)
7801 (init_filelock, init_sound): Remove prototype.
7802 * character.c (init_character_once): Remove.
7803 * filelock.c (init_filelock): Likewise.
7804 * fns.c (init_fns): Likewise.
7805 * image.c (init_image): Likewise.
7806 * sound.c (init_sound): Likewise.
7807 * emacs.c (main): Adjust accordingly.
7808
7a6136fd
DA
78092012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
7810
7811 * gtkutil.h: Tiny cleanups.
7812 (use_old_gtk_file_dialog): Remove useless declaration.
7813 (xg_uses_old_file_dialog): Add suggested const attribute.
7814
ce811ad9
EZ
78152012-07-15 Eli Zaretskii <eliz@gnu.org>
7816
7817 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
7818 (bidi_paragraph_init): Use it to limit search forward for a strong
7819 directional character in abnormally large paragraphs full of
7820 neutral or weak characters. (Bug#11943)
7821
c9adfeaa
SF
78222012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
7823
7824 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
7825 the toolbar (Bug#9451).
7826 (xg_make_tool_item): Give the widget event box a transparent
7827 background.
7828
fff62aa9
DA
78292012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
7830
7831 Cleanup basic allocation variables and functions.
7832 * alloc.c (ignore_warnings, init_intervals, init_float)
7833 (init_cons, init_symbol, init_marker): Remove.
7834 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
7835 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
7836 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
7837 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
7838 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
7839 (staticidx, init_alloc_once, init_strings, free_ablock):
7840 Remove redundant initialization.
7841 * fns.c (init_weak_hash_tables): Remove.
7842 * lisp.h (init_weak_hash_tables): Remove prototype.
7843
9730daca
DA
78442012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
7845
7846 Use zero_vector where appropriate.
7847 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
7848 accordingly.
7849 * lisp.h (zero_vector): New declaration.
7850 * font.c (null_vector): Remove.
7851 (syms_of_font): Remove initialization and staticpro.
7852 (font_list_entities, font_find_for_lface): Change to use zero_vector.
7853 * keymap.c (Faccessible_keymaps): Likewise.
7854
2e2d2a13
LL
78552012-07-15 Leo Liu <sdl.web@gmail.com>
7856
7857 * fringe.c: Fix typo in comments.
7858
cd276f6e
LL
78592012-07-14 Leo Liu <sdl.web@gmail.com>
7860
7861 * fringe.c: Add a new bitmap exclamation-mark.
7862
5a1131d9
EZ
78632012-07-14 Eli Zaretskii <eliz@gnu.org>
7864
7865 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
7866
7867 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
7868 (HAVE_MENUS): Don't define, defined by editing config.in with
7869 msdos/sed2v2.inp.
7870 (GMALLOC_INHIBIT_VALLOC): Don't define.
7871 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
7872
22e983b7
JB
78732012-07-14 Juanma Barranquero <lekktu@gmail.com>
7874
7875 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
7876
5b3f250f
GM
78772012-07-14 Glenn Morris <rgm@gnu.org>
7878
7879 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
7880 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
7881 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
7882
33d63ff4
GM
78832012-07-13 Glenn Morris <rgm@gnu.org>
7884
5b633342
GM
7885 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
7886
33d63ff4
GM
7887 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
7888 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
7889
b55b9f85
JD
78902012-07-13 Jan Djärv <jan.h.d@swipnet.se>
7891
0dc8cf50
JD
7892 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
7893 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
7894 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
7895 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
7896 where appropriate.
7897 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
7898 as boolean expression.
7899 (x_set_window_size): Remove unused variable toolbar.
7900 (ns_get_color_default, ns_mod_to_lisp): Remove.
7901 (ns_mouse_position): Remove unused variables xchar and ychar.
7902 (ns_compute_glyph_string_overhangs): Remove unused variable face.
7903 (ns_set_vertical_scroll_bar): Remove unused variable count.
7904 (ns_delete_terminal): Remove unused variable i.
7905 (ns_term_init): Remove unused variables r, g and b.
7906 (mouseDown): Remove unused variable window.
7907 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
7908 (initFrameFromEmacs): Remove unused variable vbextra.
7909 (mouseEntered): Remove unused variables p and dpyinfo.
7910 (mouseExited): Remove unused variables p and r.
7911 (ns_define_frame_cursor, ns_clear_frame_area)
7912 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
7913 (menuDown): Assign [sender tag] to variable and cast the variable.
7914
7915 * nsterm.h (menuDown): Add id as type to argument sender.
7916 (ns_display_info_for_name): Add Lisp_Object argument.
7917 (ns_term_init): Add Lisp_Object argument.
7918 (ns_map_event_to_object): Add void argument.
7919 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
7920 prototype with arguments and only declare if __OBJC__.
7921 (nxatoms_of_nsselect): Add void argument.
7922 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
7923 (ns_alloc_autorelease_pool): Add void argument.
7924 (ns_release_autorelease_pool): Add void* argument.
7925 (ns_get_defaults_value): Add const char* argument.
7926
7927 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
7928 (initFromContents): Use SSDATA where appropriate.
7929 (ns_update_menubar): Add braces to ambigous if-else.
7930 (initWithTitle): Put () around assignment in if statement.
7931 (ns_menu_show): Remove unused variables window and keymap.
7932 (update_frame_tool_bar): Remove unused variable selected_p.
7933 (initWithContentRect): Remove unused variable this_cmd_name.
7934
7935 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
7936 appropriate.
7937 (setXBMColor): Remove unused variable len.
7938 (setPixmapData): Put () around assignment in loop statement.
7939
7940 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
7941 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
7942 where appropriate.
7943 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
7944 around assignment in loop statement.
7945 (nsfont_open): Remove unused variable i.
7946 (nsfont_open): Remove unused variable len.
7947 (nsfont_draw): Remove unused variable cs.
7948
7949 * nsfns.m (x_set_icon_name, ns_set_name_internal)
7950 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
7951 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
7952 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
7953 (Fns_font_name, Fns_perform_service)
7954 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
7955 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
7956 (ns_set_name): Remove unused variable view.
7957 (x_set_menu_bar_lines): Remove unused variable olines.
7958 (x_set_tool_bar_lines): Remove unused variable root_window.
7959 (Fns_list_colors): Put () around assignment in while statement.
7960 (Fns_perform_service): Remove unused variable len.
7961 (Fns_display_usable_bounds): Remove unused variable top.
7962 (syms_of_nsfns): Remove unused variable i.
7963
b55b9f85
JD
7964 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
7965 memcpy (Bug#11907).
7966
ed9265fc 79672012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
7968
7969 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
7970 and free it with DestroyExceptionInfo (Bug#11558).
7971
ef099b57
JB
79722012-07-13 Juanma Barranquero <lekktu@gmail.com>
7973
7974 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
7975 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
7976 Set here, not in nt/config.nt.
7977
ea814a5d
EZ
79782012-07-13 Eli Zaretskii <eliz@gnu.org>
7979
7980 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
7981 cursor overflow into the last glyph on display line when the right
7982 fringe is off. (Bug#11832)
7983
1a952767
PE
79842012-07-13 Paul Eggert <eggert@cs.ucla.edu>
7985
7986 * xdisp.c (produce_special_glyphs): Now static.
7987 * dispextern.h (produce_special_glyphs): Remove decl.
7988
983188fd
GM
79892012-07-13 Glenn Morris <rgm@gnu.org>
7990
8d7c7eed 7991 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
7992 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
7993
983188fd
GM
7994 * s/usg5-4-common.h (USG, USG5):
7995 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
7996 * s/sol2-6.h (SOLARIS2):
7997 * s/irix6-5.h (IRIX6_5):
7998 * s/hpux10-20.h (USG, USG5, HPUX):
7999 * s/gnu-linux.h (USG, GNU_LINUX):
8000 * s/freebsd.h (BSD_SYSTEM):
8001 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
8002 * s/cygwin.h (CYGWIN):
8003 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
8004 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
8005
d1e68667 80062012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
8007
8008 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 8009
6de0e799
GM
80102012-07-13 Glenn Morris <rgm@gnu.org>
8011
739ae010
GM
8012 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
8013
dbee5793
GM
8014 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
8015
6de0e799
GM
8016 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
8017 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
8018
b82da769
GM
80192012-07-12 Glenn Morris <rgm@gnu.org>
8020
4fae5a7a 8021 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
8022
8023 * process.c (init_process_emacs): Rename from init_process.
8024 The old name is also the name of a Mach system call.
8025 * lisp.h, emacs.c: Update for this name change.
8026 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
8027 longer needed.
8028
5a979817
EZ
80292012-07-12 Eli Zaretskii <eliz@gnu.org>
8030
8031 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
8032 memmove call that removes glyphs covered by the left truncation
8033 glyph. Improve commentary.
8034 (display_line): Fix display of continuation glyphs on GUI frames
8035 when the right fringe is turned off and variable-size fonts are
8036 used in the window. Move the code that appends a stretch glyph to
8037 produce_special_glyphs, so that it could be used for truncation
8038 and continuation glyphs alike.
8039 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
8040 glyph of a suitably computed width, to align the special glyphs at
8041 the window margin. Code moved from display_line. (Bug#11832)
8042
3e91a053
GM
80432012-07-12 Glenn Morris <rgm@gnu.org>
8044
ba9e4b84
GM
8045 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
8046
8047 * s/gnu-linux.h, s/hpux10-20.h:
8048 Do not unconditionally define HAVE_XRMSETDATABASE.
8049
3e91a053
GM
8050 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
8051
b300b1f4
PE
80522012-07-12 Paul Eggert <eggert@cs.ucla.edu>
8053
8054 Fix typos that broke OS X build.
8055 Reported by Randal L. Schwartz in
8056 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
8057 * nsterm.m (ns_timeout): Add missing local decl.
8058 (ns_get_color): snprintf -> sprintf, to fix typo.
8059
6e777848
GM
80602012-07-12 Glenn Morris <rgm@gnu.org>
8061
3f922c37
GM
8062 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
8063 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
8064 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
8065 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
8066
0ab7b23a
GM
8067 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
8068 Move PTY_OPEN to configure.
8069
6e777848
GM
8070 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8071 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
8072 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
8073
4a7edc24
DA
80742012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
8075
8076 Use empty_unibyte_string where applicable.
8077 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
8078 * lread.c (read1): Likewise.
8079 * xsettings.c (syms_of_xsettings): Likewise.
8080
308aab79
GM
80812012-07-12 Glenn Morris <rgm@gnu.org>
8082
42bd1719
GM
8083 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
8084 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
8085 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
8086 * s/hpux10-20.h (RUN_TIME_REMAP):
8087 * s/bsd-common.h (TABDLY): Move to configure.
8088
8089 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
8090
8091 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
8092
ea0bbd17 8093 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 8094 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
8095
8096 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 8097
308aab79
GM
8098 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
8099 * s/template.h: Move NARROWPROTO to configure.
8100
ee1cf5cf
GM
81012012-07-11 Glenn Morris <rgm@gnu.org>
8102
30fe9bf4
GM
8103 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
8104 unused since 2011-01-17 change to systty.h.
8105
ee1cf5cf
GM
8106 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
8107 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
8108 Move HAVE_PTYS and HAVE_SOCKETS to configure.
8109
63e47e07
PE
81102012-07-11 Paul Eggert <eggert@cs.ucla.edu>
8111
8112 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
8113
c43fb4c3
GM
81142012-07-11 Glenn Morris <rgm@gnu.org>
8115
8116 * s/darwin.h, s/gnu-linux.h, s/template.h:
8117 Move INTERRUPT_INPUT to configure.
8118
e8df9267
DA
81192012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
8120
8121 Minor adjustments to interning code.
8122 * lisp.h (intern, intern_c_string): Redefine as static inline
8123 wrappers for intern_1 and intern_c_string_1, respectively.
8124 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
8125 * lread.c (intern_1, intern_c_string_1, oblookup):
8126 Simplify Vobarray checking.
e8df9267
DA
8127 * font.c (font_intern_prop): Likewise. Adjust comment.
8128 * w32font.c (intern_font_name): Likewise.
8129
34348bd4
AS
81302012-07-11 Andreas Schwab <schwab@linux-m68k.org>
8131
d96a1e0c
AS
8132 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
8133
34348bd4
AS
8134 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
8135 of Fcar/Fcdr if possible.
8136 * font.c (check_otf_features): Likewise.
8137 * fontset.c (Fnew_fontset): Likewise.
8138 * gnutls.c (Fgnutls_boot): Likewise.
8139 * minibuf.c (read_minibuf): Likewise.
8140 * msdos.c (IT_set_frame_parameters): Likewise.
8141 * xmenu.c (Fx_popup_dialog): Likewise.
8142 * w32menu.c (Fx_popup_dialog): Likewise.
8143
c8add24e
GM
81442012-07-11 Glenn Morris <rgm@gnu.org>
8145
4b575b3c
GM
8146 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
8147 since nothing has defined it on these platforms.
8148
09f4e3b0
GM
8149 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
8150 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
8151
172bedef
GM
8152 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8153 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
8154 Move CLASH_DETECTION to configure.
8155
249685df
GM
8156 * s/gnu.h: Remove file, which is now empty.
8157
c8add24e
GM
8158 * s/gnu.h, s/gnu-linux.h:
8159 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
8160
b41253a3
JW
81612012-07-11 John Wiegley <johnw@newartisans.com>
8162
8163 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
8164 function attribute, so we only use it if it exists in the
8165 compiler.
8166
d923b542
DA
81672012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
8168
8169 Avoid call to strlen in fast_c_string_match_ignore_case.
8170 * search.c (fast_c_string_match_ignore_case): Change to use
8171 length argument. Adjust users accordingly.
8172 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
8173
5ebbef1d
PE
81742012-07-11 Paul Eggert <eggert@cs.ucla.edu>
8175
bb352260
PE
8176 Assume mkdir, rmdir.
8177 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
8178 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
8179
57054ddd
PE
8180 Assume rename.
8181 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
8182
b747d3f7
PE
8183 Assume perror.
8184 * s/hpux10-20.h (HAVE_PERROR): Remove.
8185 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
8186 Remove dummy definition, as this problem was obsolete long ago.
8187
5ebbef1d
PE
8188 Assume strerror.
8189 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
8190
984e7f30
DA
81912012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
8192
8193 Avoid calls to strlen in font processing functions.
8194 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
8195 (font_open_by_name): Change to use length argument.
8196 Adjust users accordingly.
d923b542
DA
8197 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
8198 Adjust prototypes.
8199 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
8200 Change to return ptrdiff_t.
984e7f30
DA
8201 (xfont_list_pattern, xfont_match): Use length returned by
8202 xfont_decode_coding_xlfd.
8203 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
8204
20e94fdd
GM
82052012-07-11 Glenn Morris <rgm@gnu.org>
8206
9d596af3
GM
8207 * s/darwin.h, s/freebsd.h, s/netbsd.h:
8208 Move DONT_REOPEN_PTY to configure.
8209
20e94fdd
GM
8210 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
8211 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
8212
e99a530f
PE
82132012-07-10 Paul Eggert <eggert@cs.ucla.edu>
8214
22ffb973
PE
8215 Remove "#define unix" that is no longer needed (Bug#11905).
8216 * s/aix4-2.h (unix): Remove; no longer needed.
8217
e9a9ae03
PE
8218 EMACS_TIME simplification (Bug#11875).
8219 This replaces macros (which typically do not work in GDB)
8220 with functions, typedefs and enums, making the code easier to debug.
8221 The functional style also makes code easier to read and maintain.
8222 * systime.h: Include <sys/time.h> on all hosts, not just if
8223 WINDOWSNT, since 'struct timeval' is needed in general.
8224 (EMACS_TIME): Now a typedef, not a macro.
8225 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
8226 not macros.
8227 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
8228 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
8229 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
8230 (EMACS_TIME_LE): Now functions, not macros.
8231 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
8232 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
8233 which are not functions. All uses rewritten to use:
8234 (make_emacs_time): New function.
8235 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
8236 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
8237 not functions. All uses rewritten to use the following, respectively:
8238 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
8239 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 8240 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
8241 * fileio.c (Fcopy_file):
8242 * xterm.c (XTflash): Get the current time closer to when it's used.
8243 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
8244
ffacb126
PE
8245 * bytecode.c (targets): Suppress -Woverride-init warnings.
8246
e99a530f
PE
8247 Simplify by avoiding confusing use of strncpy etc.
8248 * doc.c (Fsnarf_documentation):
8249 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
8250 * frame.c (Fmake_terminal_frame):
8251 * gtkutil.c (get_utf8_string):
8252 * lread.c (openp):
8253 * nsmenu.m (ns_update_menubar):
8254 * regex.c (regerror):
8255 Prefer memcpy to strncpy and strncat when either will do.
8256 * fileio.c (Fsubstitute_in_file_name):
8257 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
8258 (menu_separator_name_p):
8259 * nsmenu.m (ns_update_menubar):
8260 Prefer memcmp to strncmp when either will do.
8261 * nsterm.m: Include <ftoastr.h>.
8262 (ns_get_color):
8263 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
8264 Prefer snprintf to strncpy.
8265 * nsterm.m (ns_term_init):
8266 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
8267 * nsterm.m (ns_term_init):
8268 Avoid the need for strncpy, by using build_string or
8269 make_unibyte_string directly. Use dtoastr, not snprintf.
8270 * process.c (Fmake_network_process): Diagnose service names that
8271 are too long, rather than silently truncating them or creating
8272 non-null-terminated names.
8273 (Fnetwork_interface_info): Likewise, for interface names.
8274 * sysdep.c (system_process_attributes) [GNU_LINUX]:
8275 Prefer sprintf to strncat.
8276 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
8277 Prefer vsnprintf to vsprintf + strncpy.
8278
c59592b3
GM
82792012-07-10 Glenn Morris <rgm@gnu.org>
8280
8281 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
8282 Clarify fallback case.
8283
7d7bbefd
DA
82842012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
8285
8286 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
8287 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
8288 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 8289 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
8290 where argument type is known to be a Lisp_Cons.
8291
3a4c8000
TT
82922012-07-10 Tom Tromey <tromey@redhat.com>
8293
8294 * bytecode.c (BYTE_CODE_THREADED): New macro.
8295 (BYTE_CODES): New macro. Replaces all old byte-code defines.
8296 (enum byte_code_op): New type.
8297 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
8298 (exec_byte_code): Use them. Use token threading when applicable.
8299
2a0213a6
DA
83002012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
8301
8302 Optimize pure C strings initialization.
8303 * lisp.h (make_pure_string): Fix prototype.
8304 (build_pure_c_string): New function, defined as static inline. This
8305 provides a better opportunity to optimize away calls to strlen when
8306 the function is called with compile-time constant argument.
8307 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
8308 argument, adjust users accordingly. Use build_pure_c_string where
8309 appropriate.
8310 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
8311 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
8312 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
8313
cb1caeaf
DA
83142012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
8315
8316 Avoid calls to strlen in miscellaneous functions.
8317 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
8318 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
8319 * lread.c (openp): Likewise.
8320
c293e30c
DA
83212012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
8322
8323 Avoid calls to strlen in path processing functions.
8324 * fileio.c (file_name_as_directory): Add comment. Change to add
8325 srclen argument and return the length of result. Adjust users
8326 accordingly.
8327 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
8328 swap 1st and 2nd arguments to obey the common convention.
8329 Adjust users accordingly.
c293e30c
DA
8330 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
8331
9e059e3f
GM
83322012-07-10 Glenn Morris <rgm@gnu.org>
8333
d02eb359
GM
8334 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
8335 Move PENDING_OUTPUT_COUNT definition to configure.
8336
882cf227
GM
8337 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
8338 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
8339 * s/gnu.h (DATA_START): Move definitions to configure.
8340
af6e839f
GM
8341 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
8342 We include usg5-4-common.h, which defines them both.
8343
40289a12
GM
8344 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
8345 O_RDONLY already includes it).
8346
9e059e3f
GM
8347 Stop ns builds setting the EMACSLOADPATH environment variable.
8348 * nsterm.m (ns_load_path): Rename from ns_init_paths.
8349 Now it does not set EMACSLOADPATH, just returns the load-path string.
8350 * nsterm.h: Update accordingly.
8351 * lread.c [HAVE_NS]: Include nsterm.h.
8352 (init_lread) [HAVE_NS]: Use ns_load_path.
8353 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
8354
7c4e8ec0
GM
83552012-07-09 Glenn Morris <rgm@gnu.org>
8356
d4f600ff
GM
8357 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
8358 since the included bsd-common.h does so.
8359
cbb31951
GM
8360 Stop ns builds setting the EMACSPATH environment variable.
8361 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
8362 (ns_init_paths): Do not set EMACSPATH.
8363 * nsterm.h (ns_exec_path): Add it.
8364 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
8365 Use ns_exec_path.
8366
7c4e8ec0
GM
8367 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
8368
26bccfae
PE
83692012-07-09 Paul Eggert <eggert@cs.ucla.edu>
8370
a0bee46f
PE
8371 * process.c (wait_reading_process_output): 'waitchannels' was unset
8372 when read_kbd || !NILP (wait_for_cell); fix this.
8373
5994c183
PE
8374 Add GCC-style 'const' attribute to functions that can use it.
8375 * character.h (char_resolve_modifier_mask):
8376 * keyboard.h (make_ctrl_char):
8377 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
8378 (init_character_once, next_almost_prime, init_fns, init_image)
8379 (flush_pending_output, init_sound):
8380 * mem-limits.h (start_of_data):
8381 * menu.h (finish_menu_items):
8382 Add ATTRIBUTE_CONST.
8383 * emacs.c (DEFINE_DUMMY_FUNCTION):
8384 Declare the dummy function with ATTRIBUTE_CONST.
8385 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
8386 Add decls with ATTRIBUTE_CONST.
8387
26bccfae
PE
8388 Minor improvements to make_formatted_string.
8389 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
8390 where int is good enough, as vsprintf returns an int.
8391 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
8392
a8290ec3
DA
83932012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
8394
8395 Use make_formatted_string to avoid double length calculation.
8396 * lisp.h (make_formatted_string): New prototype.
8397 * alloc.c (make_formatted_string): New function.
8398 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 8399 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
8400 * editfns.c (Fcurrent_time_zone): Likewise.
8401 * filelock.c (get_boot_time): Likewise.
8402 * frame.c (make_terminal_frame, set_term_frame_name)
8403 (x_report_frame_params): Likewise.
8404 * image.c (gs_load): Likewise.
8405 * minibuf.c (get_minibuffer): Likewise.
8406 * msdos.c (dos_set_window_size): Likewise.
8407 * process.c (make_process): Likewise.
8408 * xdisp.c (ensure_echo_area_buffers): Likewise.
8409 * xsettings.c (apply_xft_settings): Likewise.
8410
d01ba2f1
GM
84112012-07-09 Glenn Morris <rgm@gnu.org>
8412
8413 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
8414 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
8415 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
8416 * nsterm.h (ns_etc_directory): Add it.
8417 * callproc.c [HAVE_NS]: Include nsterm.h.
8418 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
8419
f1f924b6
DA
84202012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
8421
8422 Move marker debugging code under MARKER_DEBUG.
8423 * marker.c (MARKER_DEBUG): Move marker debugging code under
8424 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
8425 for bootstrap with --enable-checking (~3x slowdown reported
8426 by Juanma Barranquero <lekktu@gmail.com>).
8427 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
8428
ab531b66
PE
84292012-07-08 Paul Eggert <eggert@cs.ucla.edu>
8430
8431 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
8432 See <http://bugs.gnu.org/11825#29>.
8433
c4b3bc8a
EZ
84342012-07-08 Eli Zaretskii <eliz@gnu.org>
8435
8436 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
8437 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
8438 (display_line): Add commentary about displaying truncation glyphs
8439 on GUI frames.
8440 (produce_special_glyphs): Move here from term.c.
8441
8442 * term.c (produce_special_glyphs): Move to xdisp.c.
8443
8444 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
8445 section.
c4b3bc8a 8446
b676b881
AS
84472012-07-07 Andreas Schwab <schwab@linux-m68k.org>
8448
f17c5273
AS
8449 * xdisp.c (display_line): Avoid warning about implicit declaration
8450 of FRAME_FONT.
8451
298819b9
AS
8452 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
8453
b676b881
AS
8454 * lisp.h: Remove empty conditional.
8455
6045c4fd
PE
84562012-07-07 Paul Eggert <eggert@cs.ucla.edu>
8457
b3350bf9
PE
8458 * lread.c (load_path_check): Now static.
8459
6045c4fd
PE
8460 Fix some minor --with-ns problems found by static checking.
8461 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
8462 (x_set_font) [!HAVE_X_WINDOWS]:
8463 * image.c (xpm_load_image) [HAVE_NS]:
8464 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
8465 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
8466 Remove unused local.
8467 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
8468 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
8469 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
8470 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
8471 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
8472 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
8473 Fix pointer signedness problem.
8474 * xfaces.c (FRAME_X_FONT_TABLE):
8475 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
8476
929e7845
GM
84772012-07-07 Glenn Morris <rgm@gnu.org>
8478
8479 * lread.c (load_path_check): New function, split from init_lread.
8480 (init_lread): Reorganize. Motivation:
8481 If EMACSLOADPATH is set, check/warn about that rather than the
8482 defaults, which we are not going to use. Hence we can remove
8483 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
8484 Don't warn if site-lisp directories are missing.
8485 If not installed, start from a blank load-path, since
8486 PATH_LOADSEARCH refers to the eventual installation directories.
8487
58dd0aa4
EZ
84882012-07-07 Eli Zaretskii <eliz@gnu.org>
8489
8490 Support truncation and continuation glyphs on GUI frames, when
8491 fringes are disabled. (Bug#11832)
8492 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
8493 continuation glyphs even if on GUI frames.
8494 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
8495 or both, are absent.
8496 (start_display, move_it_in_display_line_to): Handle the case of a
8497 GUI frame without a fringe to display continuation or truncation
8498 glyphs.
8499 (insert_left_trunc_glyphs): Support GUI frames: make sure
8500 truncation glyphs overwrite enough glyphs from the current line to
8501 have sufficient space in pixels.
8502 (display_line): Support truncation and continuation glyphs on GUI
8503 frames. If some spare pixels are left on the line after inserting
8504 the truncation glyphs, fill that space with a stretch glyph of a
8505 suitably computed width.
8506
8507 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
8508 produce_glyphs, to support GUI sessions.
8509
31571fd7
PE
85102012-07-07 Paul Eggert <eggert@cs.ucla.edu>
8511
5a16b9bc
PE
8512 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
8513
f3047c75
PE
8514 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
8515
31571fd7
PE
8516 Do not require float-time's arg to fit in time_t (Bug#11825).
8517 This works better on hosts where time_t is unsigned, and where
8518 float-time is applied to the (negative) difference between two times.
8519 * editfns.c (decode_time_components): Last arg is now double *,
8520 not int *, and means to store all the result as a double, without
8521 worrying about whether the seconds part fits in time_t.
8522 All callers changed.
8523 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
8524 All callers changed.
8525 (Ffloat_time): Do not fail merely because the specified time falls
8526 outside of time_t range.
8527
4516fbef
GM
85282012-07-07 Glenn Morris <rgm@gnu.org>
8529
8530 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
8531 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
8532 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
8533
07adc2c6
JB
85342012-07-07 Juanma Barranquero <lekktu@gmail.com>
8535
8536 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
8537 Update dependencies.
8538
8539 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
8540
fd573f31
PE
85412012-07-06 Paul Eggert <eggert@cs.ucla.edu>
8542
fee5959d
PE
8543 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
8544 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
8545 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
8546 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
8547 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
8548 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
8549
fd573f31
PE
8550 * xfont.c (compare_font_names): Redo to omit the need for casts.
8551
ddadbc0e
AS
85522012-07-06 Andreas Schwab <schwab@linux-m68k.org>
8553
fca8d6b6
AS
8554 * xfns.c (Fx_change_window_property): Doc fix.
8555 * w32fns.c (Fx_change_window_property): Doc fix.
8556
ddadbc0e
AS
8557 * w32fns.c (Fx_window_property): Accept the same arguments as the
8558 X Windows version. Doc fix.
8559 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
8560
ed9265fc 85612012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
8562 Eli Zaretskii <eliz@gnu.org>
8563
8564 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
8565 Windows-specific code from nt/config.nt moved here.
8566 Obsolete settings removed.
8567
216ee680
PE
85682012-07-06 Paul Eggert <eggert@cs.ucla.edu>
8569
8570 * process.c: Avoid unnecessary calls to gettime.
8571 (wait_reading_process_output): Don't get the time of day
8572 when gobbling data immediately and not waiting, as there's no need
8573 for it in that case. This removes a FIXME.
8574
bdd091e4
JD
85752012-07-06 Jan Djärv <jan.h.d@swipnet.se>
8576
8577 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
8578 is defined (Bug#11768).
8579
9d44f8ce
DA
85802012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8581
8582 Fix marker debugging code.
8583 * marker.c (byte_char_debug_check): Do not perform the check
8584 if buffer is not multibyte.
090bd7cb
JB
8585 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
8586 Call byte_char_debug_check with correct arguments.
9d44f8ce 8587
90fc4786
DA
85882012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8589
8590 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
8591 * marker.c (byte_char_debug_check, count_markers):
8592 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
8593 (byte_debug_flag): Remove.
8594 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
8595 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
8596
7b7ae965
DA
85972012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8598
4e57b342
DA
8599 Avoid code repetition in marker-related functions.
8600 * marker.c (attach_marker): New function.
8601 (Fset_marker, set_marker_restricted, set_marker_both)
8602 (set_marker_restricted_both): Use it.
8603 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
8604 Consistently rename charno to charpos.
8605 (marker_position): Add eassert.
8606 (marker_byte_position): Convert to eassert.
8607
86082012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8609
8610 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 8611 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 8612 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 8613
657924ff
DA
86142012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8615
8616 Introduce fast path for the widely used marker operation.
8617 * alloc.c (build_marker): New function.
8618 * lisp.h (build_marker): New prototype.
8619 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
8620 * composite.c (autocmp_chars): Likewise.
8621 * editfns.c (buildmark): Remove.
8622 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
8623 (save_restriction_save): Use build_marker.
8624 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
8625 * window.c (save_window_save): Likewise.
8626
041a49a6
DA
86272012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8628
8629 Do not use Fdelete_overlay in delete_all_overlays
8630 to avoid redundant calls to unchain_overlay.
8631 * buffer.c (drop_overlay): New function.
8632 (delete_all_overlays, Fdelete_overlay): Use it.
8633 * minibuf.c (get_minibuffer): Fix comment.
8634
7dca65a4
PE
86352012-07-06 Paul Eggert <eggert@cs.ucla.edu>
8636
8637 Port to OpenBSD 5.1 amd64.
8638 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
8639 This is needed for OpenBSD, and should be harmless on all BSD systems.
8640 Also, include <sys/sysctl.h>, as it should be available on all
8641 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
8642 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
8643 use p_pid member, not kp_proc.pid.
8644
8eb876e2
GM
86452012-07-06 Glenn Morris <rgm@gnu.org>
8646
8647 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
8648
38182d90
PE
86492012-07-05 Paul Eggert <eggert@cs.ucla.edu>
8650
8651 More xmalloc and related cleanup.
8652 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
8653 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
8654 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
8655 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
8656 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
8657 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
8658 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
8659 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
8660 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
8661 * xterm.c:
8662 Omit needless casts involving void * pointers and allocation.
8663 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
8664 as the former is more robust if P's type is changed.
8665 Prefer xzalloc to xmalloc + memset 0.
8666 Simplify malloc-or-realloc to realloc.
8667 Don't worry about xmalloc returning a null pointer.
8668 Prefer xstrdup to xmalloc + strcpy.
8669 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
8670 growing it.
8671 * keyboard.c (apply_modifiers_uncached): Prefer local array to
8672 alloca of a constant.
8673
6dd5a677
EZ
86742012-07-05 Eli Zaretskii <eliz@gnu.org>
8675
8676 * xdisp.c (display_line): Fix horizontal pixel coordinates when
8677 hscroll is larger than the line width. Fixes long and futile
8678 looping inside extend_face_to_end_of_line (on a TTY) producing
8679 glyphs that are not needed and thrown away.
8680
6b312f0f
DA
86812012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
8682
8683 * marker.c (set_marker_restricted_both): Simplify by using
8684 clip_to_bounds.
8685
f520ef9b
PE
86862012-07-05 Paul Eggert <eggert@cs.ucla.edu>
8687
8688 * editfns.c (region_limit): Simplify by using clip_to_bounds.
8689
383b7c95
JD
86902012-07-05 Jan Djärv <jan.h.d@swipnet.se>
8691
8692 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
8693 not defined (Bug#11768).
8694 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
8695 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
8696 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
8697 followed by gtk_box_set_homogeneous (Bug#11768).
8698 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
8699 (update_theme_scrollbar_width, xg_create_scroll_bar):
8700 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
8701 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
8702 (is_box_type): New function (Bug#11768).
8703 (xg_tool_item_stale_p): Call is_box_type.
5293d758 8704 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
8705 with default display (Bug#11768).
8706
d6e7bf45
EZ
87072012-07-05 Eli Zaretskii <eliz@gnu.org>
8708
8709 * xdisp.c (window_hscroll_limited): New function.
8710 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
8711 coordinates when window's hscroll is set to insanely large
8712 values. (Bug#11857)
8713
431391ec
JB
87142012-07-05 Juanma Barranquero <lekktu@gmail.com>
8715
8716 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
8717 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
8718
23f86fce
DA
87192012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
8720
8721 Cleanup xmalloc.
8722 * lisp.h (xzalloc): New prototype. Omit needless casts.
8723 * alloc.c (xzalloc): New function. Omit needless casts.
8724 * charset.c: Omit needless casts. Convert all calls to
8725 xmalloc with following memset to xzalloc.
8726 * dispnew.c: Likewise.
8727 * fringe.c: Likewise.
8728 * image.c: Likewise.
8729 * sound.c: Likewise.
8730 * term.c: Likewise.
8731 * w32fns.c: Likewise.
8732 * w32font.c: Likewise.
8733 * w32term.c: Likewise.
8734 * xfaces.c: Likewise.
8735 * xfns.c: Likewise.
8736 * xterm.c: Likewise.
8737 * atimer.c: Omit needless casts.
8738 * buffer.c: Likewise.
8739 * callproc.c: Likewise.
8740 * ccl.c: Likewise.
8741 * coding.c: Likewise.
8742 * composite.c: Likewise.
8743 * doc.c: Likewise.
8744 * doprnt.c: Likewise.
8745 * editfns.c: Likewise.
8746 * emacs.c: Likewise.
8747 * eval.c: Likewise.
8748 * filelock.c: Likewise.
8749 * fns.c: Likewise.
8750 * gtkutil.c: Likewise.
8751 * keyboard.c: Likewise.
8752 * lisp.h: Likewise.
8753 * lread.c: Likewise.
8754 * minibuf.c: Likewise.
8755 * msdos.c: Likewise.
8756 * print.c: Likewise.
8757 * process.c: Likewise.
8758 * region-cache.c: Likewise.
8759 * search.c: Likewise.
8760 * sysdep.c: Likewise.
8761 * termcap.c: Likewise.
8762 * terminal.c: Likewise.
8763 * tparam.c: Likewise.
8764 * w16select.c: Likewise.
8765 * w32.c: Likewise.
8766 * w32reg.c: Likewise.
8767 * w32select.c: Likewise.
8768 * w32uniscribe.c: Likewise.
8769 * widget.c: Likewise.
8770 * xdisp.c: Likewise.
8771 * xmenu.c: Likewise.
8772 * xrdb.c: Likewise.
8773 * xselect.c: Likewise.
8774
0497dc44
PE
87752012-07-05 Paul Eggert <eggert@cs.ucla.edu>
8776
8777 * fileio.c (time_error_value): Check the right error number.
8778 Problem reported by Troels Nielsen in
8779 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
8780
356e7178
PE
87812012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8782
4e71fd89
PE
8783 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
8784 This should be fixed in a better way; see Eli Zaretskii in
8785 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
8786 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
8787
f0941253
PE
8788 * fileio.c (time_error_value): Rename from special_mtime.
8789 The old name's problems were noted by Eli Zaretskii in
8790 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
8791
065c9eb4
PE
8792 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
8793 This variable's comment says Emacs needs at least one GDB-visible
8794 symbol of type enum pvec_type, to work around GDB problems.
8795 The symbol's value doesn't matter.
8796
356e7178
PE
8797 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
8798 that causes compilation to fail on pre-C99 compilers.
8799
ed9265fc 88002012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
8801
8802 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
8803 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
8804
3884d954
DA
88052012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8806
d209e2fb 8807 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
8808 headers for buffer_defaults and buffer_local_symbols.
8809 Reported by Juanma Barranquero <lekktu@gmail.com>.
8810
ee28be33
SM
88112012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
8812
8813 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
8814 * lisp.h (enum pvec_type): Use fewer bits.
8815 (PSEUDOVECTOR_SIZE_BITS): New constant.
8816 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
8817 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
8818 change in pvec_type.
8819 (PSEUDOVECTOR_TYPEP): New macro.
8820 (TYPED_PSEUDOVECTORP): Use it.
8821 * fns.c (internal_equal): Adapt code to extract pvectype.
8822 * emacs.c (gdb_pvec_type): Update type.
8823 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
8824 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
8825 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
8826 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
8827 (sweep_vectors): Use it. Use local var `total_bytes' instead of
8828 abusing vector->header.next.nbytes.
8829 (live_vector_p): Use PVEC_TYPE.
8830 (mark_object): Adapt code to extract pvectype. Use switch.
8831
c7f2cd7f
PE
88322012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8833
8834 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
8835 Tighten new eassert a bit.
8836
8ce70ed2
DA
88372012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8838
8839 Fix compilation with --enable-gcc-warnings and -O1
8840 optimization level.
8841 * doprnt.c (doprnt): Change type of tem to int, initialize
8842 to avoid compiler warning. Add eassert.
8843 * search.c (simple_search): Initialize match_byte to avoid
8844 compiler warning. Add eassert.
8845
dea7f1e5
PE
88462012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8847
24a212eb
PE
8848 Avoid weird behavior with large horizontal scrolls.
8849 Without this change, for example, large hscroll values would
8850 mess up Emacs's display on Fedora 15 x86, presumably due to
8851 overflows in int calculations in the display code.
8852 Also, if buffers had long lines, Emacs would freeze.
8853 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
8854 (set_window_hscroll): New function, containing the old guts of
8855 Fset_window_hscroll. Return the clipped value.
8856 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
8857 This avoids the need to check against PTRDIFF_MAX.
8858
dea7f1e5
PE
8859 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
8860
76046526
DA
88612012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8862
8863 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
8864
39adff0d
PE
88652012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8866
63807d47
PE
8867 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
8868 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
8869 since GCC 4.4.6 issues a bogus warning for them.
8870
39adff0d
PE
8871 Fix bugs in file timestamp newness comparisons.
8872 * fileio.c (Ffile_newer_than_file_p):
8873 * lread.c (Fload): Use full timestamp resolution of files,
8874 not just the 1-second resolution, so that files that are only
8875 slightly newer still count as newer.
8876 * fileio.c (Ffile_newer_than_file_p): Don't assume file
8877 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
8878
dbeed9a6
PE
88792012-07-03 Paul Eggert <eggert@cs.ucla.edu>
8880
8881 * fileio.c: Improve handling of file time marker. (Bug#11852)
8882 (special_mtime): New function.
8883 (Finsert_file_contents, Fverify_visited_file_modtime):
8884 Use it to set special mtime values consistently.
8885
636334d6
AS
88862012-07-03 Andreas Schwab <schwab@linux-m68k.org>
8887
8888 * fileio.c (Finsert_file_contents): Properly handle st_mtime
8889 marker for non-existing file. (Bug#11852)
8890
e2017fe2
GM
88912012-07-03 Glenn Morris <rgm@gnu.org>
8892
8893 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
8894 and did not make it into globals.h).
8895
404dbd37
TT
88962012-07-03 Tom Tromey <tromey@redhat.com>
8897
8898 * window.c (Fset_window_margins, Fset_window_fringes)
8899 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
8900 * textprop.c (Fprevious_property_change): No longer static.
8901 * syntax.c (Fsyntax_table_p): No longer static.
8902 * process.c (Fget_process, Fprocess_datagram_address): No longer
8903 static.
8904 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
8905 * keyboard.c (Fcommand_execute): No longer static.
8906 Remove EXFUN.
8907 * insdel.c (Fcombine_after_change_execute): No longer static.
8908 * image.c (Finit_image_library): No longer static.
8909 * fileio.c (Fmake_symbolic_link): No longer static.
8910 * eval.c (Ffetch_bytecode): No longer static.
8911 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
8912 * doc.c (Fdocumentation_property, Fsnarf_documentation):
8913 No longer static.
404dbd37
TT
8914 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
8915 static.
8916 * dired.c (Ffile_attributes): No longer static.
8917 * composite.c (Fcomposition_get_gstring): No longer static.
8918 * callproc.c (Fgetenv_internal): No longer static.
8919
8920 * ccl.h: Remove EXFUNs.
8921 * buffer.h: Remove EXFUNs.
8922 * dispextern.h: Remove EXFUNs.
8923 * intervals.h: Remove EXFUNs.
8924 * fontset.h: Remove EXFUN.
8925 * font.h: Remove EXFUNs.
8926 * dosfns.c (system_process_attributes): Remove EXFUN.
8927 * keymap.h: Remove EXFUNs.
8928 * lisp.h: Remove EXFUNs.
8929 * w32term.h: Remove EXFUNs.
8930 * window.h: Remove EXFUNs.
8931 * xsettings.h: Remove EXFUN.
8932 * xterm.h: Remove EXFUN.
8933
8e4fd1e1
GM
89342012-07-03 Glenn Morris <rgm@gnu.org>
8935
8936 * lisp.h (Frandom): Make it visible to C.
8937 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
8938 buffer for invisible buffers. (Bug#1229)
8939
ca95b3eb
DA
89402012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8941
8942 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
8943 values which aren't power of 2.
14ae4239 8944 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 8945 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
8946 accordingly.
8947
7555c33f
SM
89482012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
8949
8950 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
8951
8952 * alloc.c (mark_object): Revert part of last patch to use `switch'.
8953
d12e8f5a
DA
89542012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8955
8956 * alloc.c (allocate_vector_block): Remove redundant
8957 calls to mallopt if DOUG_LEA_MALLOC is defined.
8958 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
8959 avoid calls to mallopt if zero_vector is returned.
8960
296094c3
DA
89612012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8962
8963 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
8964 is enabled, avoid dereferencing NULL current_sblock if
8965 running undumped.
8966
36429c89
DA
89672012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8968
8969 Cleanup basic buffer management.
8970 * buffer.h (struct buffer): Change layout to use generic vector
8971 marking code. Fix some comments. Change type of 'clip_changed'
8972 to bitfield. Remove unused #ifndef old.
8973 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
8974 (GET_OVERLAYS_AT): Fix indentation.
8975 (for_each_per_buffer_object_at): New macro.
8976 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
8977 (Fbuffer_local_variables): Use it.
8978 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
8979 * alloc.c (allocate_buffer): Adjust to match new layout of
8980 struct buffer. Fix comment.
8981 (mark_overlay): New function.
8982 (mark_buffer): Use it. Use mark_vectorlike to mark normal
8983 Lisp area of struct buffer.
8984 (mark_object): Use it. Adjust marking of misc objects
8985 and related comments.
8986
3b3e4cac
PE
89872012-07-02 Paul Eggert <eggert@cs.ucla.edu>
8988
8989 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
8990 wrapper that is not needed because the wrapped code is a no-op (zero
8991 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
8992 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
8993
cf5c0175
DA
89942012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
8995
8996 * alloc.c (mark_buffer): Simplify. Remove prototype.
8997 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 8998 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
8999 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
9000 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 9001
ca26824c
GM
90022012-06-30 Glenn Morris <rgm@gnu.org>
9003
2e4c5312
GM
9004 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
9005
ca26824c
GM
9006 * epaths.in (PATH_SITELOADSEARCH): New.
9007 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
9008 This is rather than relying on --enable-locallisppath elements
9009 having "site-lisp" in their names. (Bug#10208#25, 11658)
9010
0d23c240
EZ
90112012-06-30 Eli Zaretskii <eliz@gnu.org>
9012
c9240d7a
EZ
9013 * w32proc.c (sys_select): Accept and ignore one more argument.
9014
9015 * w32.c (emacs_gnutls_pull): Call select with one more argument.
9016
0d23c240 9017 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 9018 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
9019
9020 * sysdep.c: Don't include dos.h and dosfns.h.
9021
9022 * process.c (sys_select):
9023 * msdos.c (sys_select): Accept one more argument and ignore it.
9024
9025 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
9026 adapt data types and code to that.
9027
9028 * dosfns.c:
9029 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
9030 which clashes with the gnulib function of the same name.
9031
af5a5a98
AS
90322012-06-30 Andreas Schwab <schwab@linux-m68k.org>
9033
c5e4379c
AS
9034 * font.c (font_style_to_value, font_style_symbolic)
9035 (font_prop_validate_style): Add type checks for values in
9036 font_style_table.
9037
af5a5a98
AS
9038 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
9039 argument.
9040 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
9041 uses.
9042
8d38f461
EZ
90432012-06-29 Eli Zaretskii <eliz@gnu.org>
9044
2e5a6631
EZ
9045 * xdisp.c (try_window_id): Undo last change.
9046
8d38f461
EZ
9047 * w32.c (getwd): Adjust commentary about startup_dir.
9048 (init_environment): Always call sys_access, even in non-MSVC
9049 builds. Don't chdir to the directory of the Emacs executable.
9050 This undoes code from 1997 which was justified by the need to
9051 "avoid conflicts when removing and renaming directories". But its
9052 downside was that every relative file name was being interpreted
9053 relative to the directory of the Emacs executable, which can never
9054 be TRT. In particular, it broke sys_access when called with
9055 relative file names.
9056 (sys_access): Map GetLastError to errno.
9057
2af3565e
DA
90582012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
9059
9060 * window.h (struct window): Change type of 'fringes_outside_margins'
9061 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 9062 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
9063 Adjust comment.
9064 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
9065 to ptrdiff_t.
9066
c8d3a25c 90672012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 9068
c8d3a25c
GM
9069 * gnutls.c (emacs_gnutls_handshake):
9070 Add QUIT to make the loop interruptible.
57570cd3 9071
c8d3a25c 90722012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 9073
c8d3a25c
GM
9074 * charset.c (init_charset): Make lack of etc/charsets fatal.
9075
3e984ee8
DA
90762012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
9077
9078 * editfns.c (region_limit): Fix type mismatch.
9079
ef884f23
DA
90802012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
9081
9082 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
9083 undefined. Convert from xassert to eassert.
9084 * nsmenu.m: Convert from xassert to eassert.
9085 * nsterm.m: Likewise.
9086
7d7e0027
SM
90872012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
9088
9089 * editfns.c (region_limit): Clip to narrowing (bug#11770).
9090
aa754e6a
PE
90912012-06-28 Paul Eggert <eggert@cs.ucla.edu>
9092
9093 Avoid integer overflow on scroll-left and scroll-right.
9094 * window.c (HSCROLL_MAX): New macro.
9095 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
9096 overflow when requested scroll falls outside ptrdiff_t range.
9097
80b00b08
DA
90982012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
9099
9100 * window.h (struct window): Change type of 'hscroll',
9101 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
9102 'last_modified' and 'last_overlay_modified' to EMACS_INT.
9103 Adjust users accordingly.
9104 * xdisp.c (try_cursor_movement): Replace type check with eassert.
9105 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
9106 from EMACS_INT to ptrdiff_t.
9107 (make_window): Omit redundant initialization.
9108
62b2bcf6
JB
91092012-06-28 Juanma Barranquero <lekktu@gmail.com>
9110
9111 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
9112
45942c7d
DA
91132012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
9114
9115 * window.h (struct window): Change type of 'use_time' and
9116 'sequence_number' from Lisp_Object to int.
9117 * frame.c (make_frame): Adjust users accordingly.
9118 * print.c (print_object): Likewise.
9119 * window.c (select_window, Fwindow_use_time, make_parent_window)
9120 (make_window): Likewise.
9121
e509cfa6
DA
91222012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
9123
9124 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
9125 enabled with --enable-checking=[all,glyphs] configure option.
9126 Fix GLYPH_DEBUG usage assuming that it may be undefined,
9127 adjust comments accordingly.
9128 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
9129 undefined, adjust comments accordingly.
9130 * image.c: Likewise.
9131 * scroll.c: Likewise.
9132 * w32fns.c: Likewise.
9133 * w32term.c: Likewise.
9134 * xdisp.c: Likewise.
9135 * xfaces.c: Likewise.
9136 * xfns.c: Likewise.
9137 * xterm.c: Likewise.
9138
a54e2c05
DA
91392012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
9140
9141 Generalize run-time debugging checks.
9142 * dispextern.h (XASSERTS): Remove.
9143 * fontset.c (xassert): Remove.
9144 Convert from xassert to eassert.
9145 * alloc.c: Convert from xassert to eassert.
9146 * bidi.c: Likewise.
9147 * dispnew.c: Likewise.
9148 * fns.c: Likewise.
9149 * fringe.c: Likewise.
9150 * ftfont.c: Likewise.
9151 * gtkutil.c: Likewise.
9152 * image.c: Likewise.
9153 * keyboard.c: Likewise.
9154 * menu.c: Likewise.
9155 * process.c: Likewise.
9156 * scroll.c: Likewise.
9157 * sound.c: Likewise.
9158 * term.c: Likewise.
9159 * w32console.c: Likewise.
9160 * w32fns.c: Likewise.
9161 * w32term.c: Likewise.
9162 * window.c: Likewise.
9163 * xdisp.c: Likewise.
9164 * xfaces.c: Likewise.
9165 * xfns.c: Likewise.
9166 * xselect.c: Likewise.
9167 * xterm.c: Likewise.
9168
1ec4b7b2
SM
91692012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
9170
9171 * fns.c (maybe_resize_hash_table): Output message when growing the
9172 purify-hashtable.
9173
2014308a
DA
91742012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
9175
9176 * alloc.c (allocate_string_data): Remove dead code.
9177 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
9178 avoid GCC warning about unused macro.
9179
246155eb
DA
91802012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
9181
9182 * alloc.c (allocate_string): Omit intervals initialization.
9183 * alloc.c (make_uninit_multibyte_string): Initialize intervals
9184 as in make_pure_string and make_pure_c_string.
9185
43184b7b
DA
91862012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
9187
d209e2fb 9188 * alloc.c (allocate_string): Fix last change.
43184b7b 9189
3fe6dd74
DA
91902012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
9191
d209e2fb 9192 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
9193 to memset, add explicit initialization where appropriate.
9194
1ba6038a
GM
91952012-06-27 Glenn Morris <rgm@gnu.org>
9196
9197 * lisp.mk (lisp): Remove paths.elc.
9198
c89926a5
CY
91992012-06-27 Chong Yidong <cyd@gnu.org>
9200
9201 * doc.c (Fsubstitute_command_keys): Fix punctuation.
9202
ed6b3510
JW
92032012-06-26 John Wiegley <johnw@newartisans.com>
9204
1ec4b7b2 9205 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
9206 on Mac OS X Lion: __mod_init_func and __mod_term_func.
9207
ed6b3510
JW
9208 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
9209 when building with Clang.
9210
8edd4a2b
SM
92112012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
9212
9213 * eval.c (Fapply): Allow calling it with a single argument.
9214
f6f62d1b
EZ
92152012-06-26 Eli Zaretskii <eliz@gnu.org>
9216
9217 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
9218 _stricmp and _strnicmp.
9219 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
9220
62efea5e
DA
92212012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
9222
9223 * alloc.c (allocate_window): Zero out non-Lisp part of newly
9224 allocated window.
9225 (allocate_process): Likewise for new process.
8edd4a2b 9226 (allocate_terminal): Change to use offsetof.
62efea5e
DA
9227 (allocate_frame): Likewise.
9228 * frame.c (make_frame): Omit redundant initialization.
9229 * window.c (make_parent_window): Use memset.
9230 (make_window): Omit redundant initialization.
9231 * process.c (make_process): Omit redundant initialization.
9232 * terminal.c (create_terminal): Likewise.
9233
42997f4d
DA
92342012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
9235
9236 * term.c (delete_tty): Remove redundant call to memset.
9237
1130ecfc
DA
92382012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
9239
9240 * alloc.c: Remove build_string.
9241 * lisp.h: Define build_string as static inline. This provides
9242 a better opportunity to optimize away calls to strlen when the
9243 function is called with compile-time constant argument.
9244 * image.c (imagemagick_error): Convert to build_string.
9245 * w32proc.c (sys_spawnve): Likewise.
9246 * xterm.c (x_term_init): Likewise.
9247
cf38a720
PE
92482012-06-26 Paul Eggert <eggert@cs.ucla.edu>
9249
99027bdd
PE
9250 Use sprintf return value instead of invoking strlen on result.
9251 In the old days this wasn't portable, since some sprintf
9252 implementations returned char *. But they died out years ago and
9253 Emacs already assumes sprintf returns int.
9254 Similarly for float_to_string.
9255 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
9256 * ccl.c (ccl_driver):
9257 * character.c (string_escape_byte8):
9258 * data.c (Fnumber_to_string):
9259 * doprnt.c (doprnt):
9260 * print.c (print_object):
9261 * xdisp.c (message_dolog):
9262 * xfns.c (syms_of_xfns):
9263 Use sprintf or float_to_string result to avoid need to call strlen.
9264 * data.c (Fnumber_to_string):
9265 Use make_unibyte_string, since the string must be ASCII.
9266 * lisp.h, print.c (float_to_string): Now returns int length.
9267 * term.c (produce_glyphless_glyph):
9268 Use sprintf result rather than recomputing it.
9269
cf38a720
PE
9270 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
9271 * Makefile.in (ALL_CFLAGS):
9272 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
9273 * gmalloc.c, regex.c: Include <config.h> unconditionally.
9274
3511c784
DA
92752012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
9276
0a08eb21 9277 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
9278 strcasecmp if available.
9279 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
9280
fb7da12e
AS
92812012-06-25 Andreas Schwab <schwab@linux-m68k.org>
9282
9283 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
9284 Avoid comma operator.
9285 * menu.c (push_submenu_start, push_submenu_end)
9286 (push_left_right_boundary, push_menu_pane): Likewise.
9287 * msdos.c (dos_rawgetc): Likewise.
9288
afa2ffd8
DA
92892012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
9290
9291 * xfns.c (xic_create_fontsetname): Remove redundant calls
9292 to memset.
9293
b3b4476b
PE
92942012-06-25 Paul Eggert <eggert@cs.ucla.edu>
9295
4495ff38
PE
9296 * gtkutil.c (get_utf8_string): Remove redundant assignment.
9297 sprintf already null-terminates its output.
9298
b3b4476b
PE
9299 * xfns.c (x_window): Remove redundant cast.
9300
b00876c9
DA
93012012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
9302
9303 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
9304 `const char *' to `char *' to avoid compiler warning.
9305
d188e26b
PE
93062012-06-24 Paul Eggert <eggert@cs.ucla.edu>
9307
885d1d74
PE
9308 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
9309 instead of truncating it to 63 (admittedly a generous limit).
9310
d188e26b
PE
9311 * process.c: Fix spelling and caps in comments.
9312
e2f560b1
DN
93132012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
9314
e86db54b 9315 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
9316 * sysdep.c (setpgrp): Remove definition, not used in this file.
9317
7583a3a1
JB
93182012-06-24 Juanma Barranquero <lekktu@gmail.com>
9319
9320 * makefile.w32-in: Update dependencies.
9321
696056c2
EZ
93222012-06-24 Eli Zaretskii <eliz@gnu.org>
9323
9324 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
9325 (SYSTIME_H): Add nt/inc/sys/time.h.
9326
9327 * systime.h [WINDOWSNT]: Include sys/time.h.
9328
9329 * s/ms-w32.h (struct timespec): Definition moved from
9330 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
9331
845ca893
PE
93322012-06-24 Paul Eggert <eggert@cs.ucla.edu>
9333
9334 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
9335 * buffer.h (buffer_slot_type_mismatch):
9336 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
9337 * eval.c (unwind_to_catch):
9338 * image.c (my_png_error, my_error_exit):
9339 * keyboard.c (quit_throw_to_read_char, user_error)
9340 (Fexit_recursive_edit, Fabort_recursive_edit):
9341 * lisp.h (die, args_out_of_range, args_out_of_range_3)
9342 (wrong_type_argument, buffer_overflow, __executable_start)
9343 (memory_full, buffer_memory_full, string_overflow, Fthrow)
9344 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
9345 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
9346 (fatal):
9347 (child_setup) [!DOS_NT]:
9348 * lread.c (end_of_file_error, invalid_syntax):
9349 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
9350 * puresize.h (pure_write_error):
9351 * search.c (matcher_overflow):
9352 * sound.c (sound_perror, alsa_sound_perror):
9353 * sysdep.c, syssignal.h (croak):
9354 * term.c (maybe_fatal, vfatal):
9355 * textprop.c (text_read_only):
9356 * undo.c (user_error):
9357 * unexmacosx.c (unexec_error):
9358 * xterm.c (x_ins_del_lines, x_delete_glyphs):
9359 Use _Noreturn rather than NO_RETURN.
9360 No need for separate decl merely because of _Noreturn.
9361 * sound.c (sound_warning, parse_sound):
9362 Remove unnecessary forward decls.
9363
f1dd8073
PE
93642012-06-24 Paul Eggert <eggert@cs.ucla.edu>
9365
9366 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
9367 * lisp.h (WAIT_READING_MAX): New macro.
9368 * dispnew.c (Fsleep_for, sit_for):
9369 * keyboard.c (kbd_buffer_get_event):
9370 * process.c (Faccept_process_output):
9371 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
9372 This improves on the previous patch, which introduced a bug
9373 when time_t is unsigned and as wide as intmax_t.
9374 See <http://bugs.gnu.org/9000#51>.
9375
b82c1755
EZ
93762012-06-23 Eli Zaretskii <eliz@gnu.org>
9377
9378 * dispnew.c (sit_for, Fsleep_for):
9379 * keyboard.c (kbd_buffer_get_event):
9380 * process.c (Faccept_process_output): Avoid compiler warnings when
9381 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
9382
ca300656
JB
93832012-06-23 Juanma Barranquero <lekktu@gmail.com>
9384
049ec95b
JB
9385 * makefile.w32-in: Update dependencies.
9386
ca300656
JB
9387 * w32.c (ltime): Add return type and declare static.
9388 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
9389
db7b8d06
PE
93902012-06-23 Paul Eggert <eggert@cs.ucla.edu>
9391
9392 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
9393 Privately reported by Herbert J. Skuhra.
9394 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
9395 All uses changed.
9396 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
9397 not make_lisp_timeval, when the argument is of type EMACS_TIME.
9398
0bd8297f
EZ
93992012-06-23 Eli Zaretskii <eliz@gnu.org>
9400
96512555
EZ
9401 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
9402 last argument of make_unibyte_string.
9403
0bd8297f
EZ
9404 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
9405 language ID in the event parameters.
9406
9407 * w32term.c (w32_read_socket): Put the new keyboard codepage into
9408 event.code, not the obscure "character set ID".
9409
63def6b6
CY
94102012-06-23 Chong Yidong <cyd@gnu.org>
9411
9412 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
9413
e8a02204
EZ
94142012-06-23 Eli Zaretskii <eliz@gnu.org>
9415
388cdec0
EZ
9416 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
9417 * w32.c (fdutimens): New function.
9418
9419 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
9420
9421 * s/ms-w32.h (pselect): Redirect to sys_select.
9422
9423 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
9424
e8a02204
EZ
9425 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
9426 in the logic of incrementing and decrementing the value of
9427 use_relocatable_buffers.
9428
d054f3fb
PE
94292012-06-23 Paul Eggert <eggert@cs.ucla.edu>
9430
9431 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
9432 Privately reported by Herbert J. Skuhra.
9433 [__FreeBSD__]: Remove "*/" typo after "#include".
9434 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
9435 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
9436 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
9437 Don't assume EMACS_TIME and struct timeval are the same type.
9438
d35af63c
PE
94392012-06-22 Paul Eggert <eggert@cs.ucla.edu>
9440
9441 Support higher-resolution time stamps (Bug#9000).
9442 The time stamps are only nanosecond-resolution at the C level,
9443 since that's the best that any real-world system supports now.
9444 But they are picosecond-resolution at the Lisp level, as that's
9445 easy, and leaves room for future OS improvements.
9446
9447 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
9448 (LIBES): Use it.
9449
9450 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
9451 Don't get current time unless it's needed.
9452
9453 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
9454 now provides it if it's absent.
9455 (start_atimer): Port to higher-res time stamps.
9456 Check for time stamp overflow. Don't get current time more
9457 often than is needed.
9458
9459 * buffer.h (struct buffer): Buffer modtime now has high resolution.
9460 Include systime.h, not time.h.
9461 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
9462
9463 * dired.c: Include stat-time.h.
9464 (Ffile-attributes): File times now have higher resolution.
9465
9466 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
9467 (struct image): Timestamp now has higher resolution.
9468
9469 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
9470 has at least microseconds now. All uses removed.
9471 (update_frame, update_single_window, update_window, update_frame_1)
9472 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 9473 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
9474
9475 * editfns.c (time_overflow): Now extern.
9476 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
9477 (float-time, Fformat_time_string, Fcurrent_time_string)
9478 (Fcurrent_time_zone): Accept and generate higher-resolution
9479 time stamps.
9480 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
9481 (decode_time_components, lisp_seconds_argument): New functions.
9482 (make_time): Now static.
9483 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
9484 Report an error if the time is invalid, rather than having the caller
9485 do that.
9486
9487 * fileio.c: Include <stat-time.h>
9488 (Fcopy_file): Copy higher-resolution time stamps.
9489 Prefer to set the time stamp via a file descriptor if that works.
9490 (Fset_file_times, Finsert_file_contents, Fwrite_region)
9491 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
9492 (Fvisited_file_modtime, Fset_visited_file_modtime):
9493 Support higher-resolution time stamps.
9494
9495 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
9496
9497 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
9498
9499 * image.c (prepare_image_for_display, clear_image_cache)
9500 (lookup_image): Port to higer-resolution time stamps.
9501
9502 * keyboard.c (start_polling, bind_polling_period):
9503 Check for time stamp overflow.
9504 (read_char, kbd_buffer_get_event, timer_start_idle)
9505 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
9506 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
9507 Port to higher-resolution time stamps. Do not assume time_t is signed.
9508 (decode_timer): New function. Timers are now vectors of length 9,
9509 not 8, to accommodate the picosecond component.
9510 (timer_check_2): Use it.
9511
9512 * nsterm.m (select_timeout, timeval_subtract): Remove.
9513 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
9514 as they're a bit more accurate and handle overflow better.
9515 (ns_select): Change prototype to be compatible with pselect.
9516 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
9517 * nsterm.h (ns_select): Adjust prototype.
9518
9519 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
9520 us-resolution time stamps.
9521 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
9522
9523 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
9524
9525 * lisp.h (time_overflow): New decl.
9526 (wait_reading_process_output): First arg is now intmax_t, not int,
9527 to accommodate larger waits.
9528
9529 * process.h (struct Lisp_Process.read_output_delay):
9530 Now counts nanoseconds, not microseconds.
9531 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
9532 EMACS_HAS_USECS.
9533 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
9534 (wait_reading_process_output):
9535 Port to ns-resolution time stamps.
9536 (Faccept_process_output, wait_reading_process_output):
9537 Check for time stamp overflow. Do not assume time_t is signed.
9538 (select_wrapper): Remove; we now use pselect.
9539 (Fprocess_attributes): Now generates ns-resolution time stamps.
9540
9541 * sysdep.c: Include utimens.h. Don't include utime.h
9542 or worry about struct utimbuf; gnulib does that for us now.
9543 (gettimeofday): Remove; gnulib provides a substitute.
9544 (make_timeval): New function.
9545 (set_file_times): Now sets ns-resolution time stamps.
9546 New arg FD; all uses changed.
9547 (time_from_jiffies, ltime_from_jiffies, get_up_time)
9548 (system_process_attributes):
9549 Now returns ns-resolution time stamp. All uses changed.
9550 Check for time stamp overflow.
9551
9552 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
9553 provides a substitute now.
9554
9555 * systime.h: Include timespec.h rather than sys/time.h and time.h,
9556 since it guarantees struct timespec.
9557 (EMACS_TIME): Now struct timespec, so that we can support
9558 ns-resolution time stamps.
9559 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
9560 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
9561 (EMACS_USECS): Remove.
9562 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
9563 so multiply the arg by 1000 before storing it.
9564 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
9565 New macros.
9566 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
9567 Port to ns-resolution time stamps.
9568 (EMACS_TIME_NEG_P): Remove; replaced by....
9569 (EMACS_TIME_SIGN): New macro.
9570 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
9571 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
9572 (set_file_times, make_time, lisp_time_argument): Adjust signature.
9573 (make_timeval, make_lisp_time, decode_time_components): New decls.
9574 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
9575 that it mishandled time_t overflow. You can't compare by subtracting!
9576 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
9577 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
9578
9579 * term.c: Include <sys/time.h>.
9580 (timeval_to_Time): New function, for proper overflow wraparound.
9581 (term_mouse_position, term_mouse_click): Use it.
9582
9583 * undo.c (record_first_change): Support higher-resolution time stamps
9584 in the undo buffer.
9585 (Fprimitive_undo): Use them when restoring time stamps.
9586
9587 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
9588 (w32_get_internal_run_time):
9589 Port to higher-resolution Emacs time stamps.
9590 (ltime): Now accepts single 64-bit integer, as that's more convenient
9591 for callers.
9592
9593 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
9594
9595 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
9596 for compatibility with pselect. Support ns-resolution time stamps.
9597
9598 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
9599
9600 * xselect.c (wait_for_property_change, x_get_foreign_selection):
9601 Check for time stamp overflow, and support ns-resolution time stamps.
9602
9603 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
9604 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
9605 (timeval_subtract): Remove; no longer needed.
9606 (XTflash, XTring_bell, x_wait_for_event):
9607 Port to ns-resolution time stamps. Don't assume time_t is signed.
9608
b6a92dfe
CY
96092012-06-22 Chong Yidong <cyd@gnu.org>
9610
9611 * xdisp.c (x_consider_frame_title): Revert last change.
9612
d251c37c
EZ
96132012-06-22 Eli Zaretskii <eliz@gnu.org>
9614
9615 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
9616 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
9617 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
9618 staticidx goes up to 1597 out of 1600 = 0x640.)
9619
f10deafb
PE
96202012-06-20 Paul Eggert <eggert@cs.ucla.edu>
9621
9622 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
9623 Otherwise, the umask might be mistakenly 0 while handling input signals.
9624
ec6de1e2
SM
96252012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
9626
9627 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
9628
28be1ada
DA
96292012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
9630
9631 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
9632 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
9633 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
9634 access to `contents' member of Lisp_Vector objects with AREF and ASET
9635 where appropriate.
9636
c6bf3022
CY
96372012-06-19 Chong Yidong <cyd@gnu.org>
9638
9639 * frame.c (delete_frame): When selecting a frame on a different
9640 text terminal, do not alter the terminal's top-frame.
9641
9642 * xdisp.c (format_mode_line_unwind_data): Record the target
9643 frame's selected window and its terminal's top-frame.
9644 (unwind_format_mode_line): Restore them.
9645 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
9646 Callers changed.
9647 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
9648 since tty frames can be explicitly named.
9649 (prepare_menu_bars): Likewise.
9650
9651 * term.c (Ftty_top_frame): New function.
9652
defd4196
PE
96532012-06-18 Paul Eggert <eggert@cs.ucla.edu>
9654
9655 Port byte-code-meter to modern targets.
9656 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
9657 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 9658 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
9659 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
9660 (METER_1, METER_2): Simplify.
9661
1053a871
SM
96622012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
9663
9664 * data.c (Fdefalias): Return `symbol' (bug#11686).
9665
b7e8d081
MR
96662012-06-18 Martin Rudalics <rudalics@gmx.at>
9667
9668 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
9669 gets killed during executing of this function (Bug#11665).
9670 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
9671 (Vkill_buffer_query_functions): In doc-string say that functions
9672 run by this hook should not change the current buffer.
9673
7ea2b339
PE
96742012-06-18 Paul Eggert <eggert@cs.ucla.edu>
9675
9676 Fix recently-introduced process.c problems found by static checking.
9677 * process.c (write_queue_push, write_queue_pop, send_process):
9678 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
9679 (write_queue_pop): Fix pointer signedness problem.
9680 (send_process): Remove unused local.
9681
96a313a1
CY
96822012-06-17 Chong Yidong <cyd@gnu.org>
9683
9684 * xdisp.c (redisplay_internal): No need to redisplay terminal
9685 frames that are not on top.
9686
20ca2e94
TN
96872012-06-17 Troels Nielsen <bn.troels@gmail.com>
9688
9689 * process.c (make_process): Initialize write_queue.
9690 (write_queue_push, write_queue_pop): New functions.
9691 (send_process): Use them to maintain correct ordering of process
9692 writes (Bug#10815).
9693
9a900ca9
PE
96942012-06-17 Paul Eggert <eggert@cs.ucla.edu>
9695
310fbfa8
PE
9696 * lisp.h (eassert): Assume C89 or later.
9697 This removes the need for CHECK.
9698 (CHECK): Remove. Its comments about always evaluating its
9699 argument were confusing, as 'eassert' typically does not evaluate
9700 its argument.
9701
27bb1ca4
PE
9702 * coding.c (produce_chars): Use ptrdiff_t, not int.
9703
9a900ca9
PE
9704 * xterm.c (x_draw_underwave): Check for integer overflow.
9705 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
9706
41b7f8bc 97072012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
9708
9709 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
9710 referenced (Bug#11583).
9711
9b0e3eba
AA
97122012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
9713
9714 Implement wave-style variant of underlining.
9715 * dispextern.h (face_underline_type): New enum.
9716 (face): Add field for underline type.
9717 * nsterm.m (ns_draw_underwave): New function.
9718 (ns_draw_text_decoration): Use it.
9719 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
9720 New functions.
9721 (x_draw_glyph_string): Use them.
9722 * xfaces.c (Qline, Qwave): New Lisp objects.
9723 (check_lface_attrs, merge_face_ref)
1053a871
SM
9724 (Finternal_set_lisp_face_attribute, realize_x_face):
9725 Handle wave-style underline face attributes.
9b0e3eba
AA
9726 * xterm.c (x_draw_underwave): New function.
9727 (x_draw_glyph_string): Use it.
9728
0fb52f11
JB
97292012-06-16 Juanma Barranquero <lekktu@gmail.com>
9730
9731 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
9732 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
9733 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
9734 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
9735 ($(BLD)/w32select.$(O)): Update dependencies.
9736
e5560ff7
AS
97372012-06-16 Andreas Schwab <schwab@linux-m68k.org>
9738
9739 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
9740 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
9741 * character.c (_fetch_multibyte_char_p): Remove.
9742 * alloc.c: Include "character.h" before "buffer.h".
9743 * bidi.c: Likewise.
9744 * buffer.c: Likewise.
9745 * bytecode.c: Likewise.
9746 * callint.c: Likewise.
9747 * callproc.c: Likewise.
9748 * casefiddle.c: Likewise.
9749 * casetab.c: Likewise.
9750 * category.c: Likewise.
9751 * cmds.c: Likewise.
9752 * coding.c: Likewise.
9753 * composite.c: Likewise.
9754 * dired.c: Likewise.
9755 * dispnew.c: Likewise.
9756 * doc.c: Likewise.
9757 * dosfns.c: Likewise.
9758 * editfns.c: Likewise.
9759 * emacs.c: Likewise.
9760 * fileio.c: Likewise.
9761 * filelock.c: Likewise.
9762 * font.c: Likewise.
9763 * fontset.c: Likewise.
9764 * fringe.c: Likewise.
9765 * indent.c: Likewise.
9766 * insdel.c: Likewise.
9767 * intervals.c: Likewise.
9768 * keyboard.c: Likewise.
9769 * keymap.c: Likewise.
9770 * lread.c: Likewise.
9771 * macros.c: Likewise.
9772 * marker.c: Likewise.
9773 * minibuf.c: Likewise.
9774 * nsfns.m: Likewise.
9775 * nsmenu.m: Likewise.
9776 * print.c: Likewise.
9777 * process.c: Likewise.
9778 * regex.c: Likewise.
9779 * region-cache.c: Likewise.
9780 * search.c: Likewise.
9781 * syntax.c: Likewise.
9782 * term.c: Likewise.
9783 * textprop.c: Likewise.
9784 * undo.c: Likewise.
9785 * unexsol.c: Likewise.
9786 * w16select.c: Likewise.
9787 * w32fns.c: Likewise.
9788 * w32menu.c: Likewise.
9789 * window.c: Likewise.
9790 * xdisp.c: Likewise.
9791 * xfns.c: Likewise.
9792 * xmenu.c: Likewise.
9793 * xml.c: Likewise.
9794 * xselect.c: Likewise.
9795
2f07e6af
EZ
97962012-06-16 Eli Zaretskii <eliz@gnu.org>
9797
1053a871
SM
9798 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
9799 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 9800 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
9801 row.
9802 (handle_face_prop): Use chunk-relative overlay string index when
9803 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
9804 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
9805 the rightmost. (Bug#11720)
2f07e6af 9806
29b83cec
AS
98072012-06-16 Andreas Schwab <schwab@linux-m68k.org>
9808
9809 * category.h (CHAR_HAS_CATEGORY): Define as inline.
9810 (CATEGORY_MEMBER): Enforce 1/0 value.
9811 * category.c (_temp_category_set): Remove.
9812
4c5501e9
EZ
98132012-06-16 Eli Zaretskii <eliz@gnu.org>
9814
9815 * window.c (Fdelete_other_windows_internal)
9816 (Fdelete_window_internal): Don't access frame's mouse highlight
9817 info of the initial frame. (Bug#11677)
9818
2b570124
PE
98192012-06-14 Paul Eggert <eggert@cs.ucla.edu>
9820
e93864f9
PE
9821 * .gdbinit (xgetint): Fix recently-introduced paren typo.
9822 Assume USE_2_TAGS_FOR_INTS.
9823 (xreload): Adjust $tagmask width to match recent lisp.h change.
9824
2b570124
PE
9825 Simplify lisp.h in minor ways that should not affect code.
9826 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
9827 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
9828 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
9829 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
9830 (INTTYPEBITS): New macro, for clarity.
9831 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
9832 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
9833 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
9834 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
9835 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
9836
81755f69
JB
98372012-06-13 Juanma Barranquero <lekktu@gmail.com>
9838
9839 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
9840
16192a57
GM
98412012-06-13 Glenn Morris <rgm@gnu.org>
9842
9843 * s/bsd-common.h (BSD4_3):
9844 * s/usg5-4-common.h (USG5_4): No longer define; unused.
9845
646b5f55
AS
98462012-06-13 Andreas Schwab <schwab@linux-m68k.org>
9847
9848 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
9849 instead of union.
9850 (XLI, XIL): Define.
1053a871
SM
9851 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
9852 Use them.
9853 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 9854 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 9855 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
9856 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
9857 * frame.c (delete_frame): Remove outdated comment.
9858 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
9859 USE_LISP_UNION_TYPE.
9860 (Fw32_unregister_hot_key): Likewise.
9861 (Fw32_toggle_lock_key): Likewise.
9862 * w32menu.c (add_menu_item): Likewise.
9863 (w32_menu_display_help): Use XIL instead of checking
9864 USE_LISP_UNION_TYPE.
9865 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
9866 (init_heap): Likewise.
9867 * w32term.c (w32_read_socket): Update comment.
9868
1d3823c9
GM
98692012-06-13 Glenn Morris <rgm@gnu.org>
9870
c62ff706
GM
9871 * s/usg5-4-common.h, src/s/unixware.h:
9872 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
9873
1d3823c9
GM
9874 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
9875
bfe3e0a2
PE
98762012-06-13 Paul Eggert <eggert@cs.ucla.edu>
9877
9878 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
9879 * alloc.c (make_number) [!defined make_number]:
9880 Remove, as lisp.h always defines this now.
9881 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
9882 (roundup_size): Verify that it is a power of 2.
9883 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
9884 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
9885 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
9886 -DUSE_LSB_TAG=0, to override the automatically-selected default.
9887 USE_LSB_TAG now is always defined to be either 0 or 1.
9888 All uses changed.
9889 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
9890 code works fine either way, and efficiency is not a concern here,
9891 as the union type is for debugging, not for production.
9892 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
9893 Use an inline function on all platforms when using the union type,
9894 since this is simpler and 'static inline' can be used portably
9895 within Emacs now.
9896 (LISP_INITIALLY_ZERO): New macro.
9897 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
9898 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
9899
45fa9c0f
GM
99002012-06-12 Glenn Morris <rgm@gnu.org>
9901
b4492cba
GM
9902 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
9903
9904 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 9905
45fa9c0f
GM
9906 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
9907 Move BROKEN_SIGIO to configure.
9908
9909 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
9910 Move NO_TERMIO to configure.
9911
0e25d334
CY
99122012-06-12 Chong Yidong <cyd@gnu.org>
9913
9914 * image.c (imagemagick_load_image): Use MagickFlattenImage if
9915 MagickMergeImageLayers is undefined. Use pixel pusher loop if
9916 MagickExportImagePixels is undefined.
9917
43682bb6
PE
99182012-06-12 Paul Eggert <eggert@cs.ucla.edu>
9919
9920 * image.c (imagemagick_load_image): Remove unused label.
9921
a9be7d2b
GM
99222012-06-11 Glenn Morris <rgm@gnu.org>
9923
9924 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9925 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
9926 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
9927 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
9928
3017f87f
SM
99292012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
9930
9931 * alloc.c (make_byte_code): New function.
9932 (Fmake_byte_code): Use it. Don't purify here.
9933 * lread.c (read1): Use it as well to avoid extra allocation.
9934
1b9b4cf4
CY
99352012-06-11 Chong Yidong <cyd@gnu.org>
9936
9937 * image.c (imagemagick_load_image): Implement transparency.
9938
95988fcf
AS
99392012-06-10 Andreas Schwab <schwab@linux-m68k.org>
9940
9941 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
9942 account for preceding backslashes. (Bug#11663)
9943
cd4eb164
CY
99442012-06-09 Chong Yidong <cyd@gnu.org>
9945
9946 * term.c: Support italics in capable terminals (Bug#9652).
9947 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
9948 (turn_on_face): Output using TS_enter_italic_mode if available.
9949 Don't handle unused blinking and alt-charset cases.
9950 (turn_off_face): Handle italic case; discard unused tty_blinking_p
9951 and tty_alt_charset_p cases.
9952 (tty_capable_p, init_tty): Support italics.
9953
9954 * termchar.h (struct tty_display_info): Add field for italics.
9955 Remove unused blink field.
9956
9957 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
9958 Handle slant.
9959
9960 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
9961 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
9962 tty_alt_charset_p. Add tty_italic_p.
9963
ff88beb8
MA
99642012-06-09 Michael Albinus <michael.albinus@gmx.de>
9965
9966 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
9967 dbus_type_is_basic if available.
9968 (xd_extract_signed, xd_extract_unsigned): Rename from
9969 extract_signed and extract_unsigned, respectively. Adapt callers.
9970
44286096
CY
99712012-06-09 Chong Yidong <cyd@gnu.org>
9972
1682701f
CY
9973 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
9974
44286096
CY
9975 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
9976 case (Bug#9752).
9977
d86feb17
PE
99782012-06-08 Paul Eggert <eggert@cs.ucla.edu>
9979
9980 * xdisp.c (vmessage): Treat frame message as multibyte.
9981 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
9982 would generate the diagnostic "Making \302\247 buffer-local while
9983 let-bound!".
9984
d5c20fe8
EZ
99852012-06-08 Eli Zaretskii <eliz@gnu.org>
9986
9987 * dispnew.c (showing_window_margins_p): Undo last change, which
9988 was done due to an inadvertent commit.
9989 (adjust_frame_glyphs_for_frame_redisplay): Do call
9990 showing_window_margins_p.
9991
513749ee
SM
99922012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
9993
9994 * eval.c (Fmake_var_non_special): New primitive.
9995 (syms_of_eval): Defsubr it.
9996 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
9997
d4a8f5c1
JB
99982012-06-08 Juanma Barranquero <lekktu@gmail.com>
9999
10000 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
10001 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
10002
8bbbc977
EZ
100032012-06-08 Eli Zaretskii <eliz@gnu.org>
10004
10005 * alloc.c (allocate_vectorlike): Fix last change.
10006
f3372c87
DA
100072012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
10008
10009 Block-based vector allocation of small vectors.
10010 * lisp.h (struct vectorlike_header): New field `nbytes',
10011 adjust comment accordingly.
10012 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 10013 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
10014 mark_maybe_pointer, valid_lisp_object_p) accordingly.
10015 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
10016 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
10017 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
10018 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
10019 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
10020 (roundup_size): New constant.
10021 (struct vector_block): New data type.
10022 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 10023 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
10024 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
10025 (sweep_vectors): New functions.
10026 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 10027 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
10028 or equal to VBLOCK_BYTES_MAX.
10029 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
10030 (init_alloc_once): Add call to init_vectors.
10031
4f18a4ed
SM
100322012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
10033
10034 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
10035
86f158bc
PE
100362012-06-07 Paul Eggert <eggert@cs.ucla.edu>
10037
10038 * doprnt.c (doprnt): Truncate multibyte char correctly.
10039 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
10040 would mishandle a string argument "Xc" if X was a multibyte
10041 character of length 2: it would truncate after X's first byte
10042 rather than including all of X.
10043
c5cfcbe0
CY
100442012-06-06 Chong Yidong <cyd@gnu.org>
10045
10046 * buffer.c (word_wrap): Doc fix.
10047
c05cf390
PE
100482012-06-04 Paul Eggert <eggert@cs.ucla.edu>
10049
10050 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
10051
0c3461de
GM
100522012-06-03 Glenn Morris <rgm@gnu.org>
10053
10054 * xdisp.c (tool-bar-style): Doc fix.
10055
c71232db
UM
100562012-06-03 Ulrich Müller <ulm@gentoo.org>
10057
10058 * Makefile.in (PAXCTL): Define.
10059 (temacs$(EXEEXT)): Disable memory randomization for the temacs
10060 binary via PaX flags if the paxctl utility is available.
10061 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
10062 Restore PaX flags to their default. (Bug#11398)
10063
383f7350
CY
100642012-06-03 Chong Yidong <cyd@gnu.org>
10065
10066 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
10067 buffer (Bug#11226).
10068
5f2c76c6
CY
100692012-06-03 Chong Yidong <cyd@gnu.org>
10070
10071 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
10072 (note_mode_line_or_margin_highlight): If there is no help echo,
10073 use mode-line-default-help-echo. Handle the case where the mouse
10074 position is past the end of the mode line string.
10075
10076 * buffer.c (buffer_local_value_1): New function, split from
10077 Fbuffer_local_value; can return Qunbound.
10078 (Fbuffer_local_value): Use it.
10079 (Vmode_line_format): Docstring tweaks.
10080
773d47f6
PE
100812012-06-02 Paul Eggert <eggert@cs.ucla.edu>
10082
10083 * sysdep.c (system_process_attributes): Improve comment.
10084
f2d6a3df
SM
100852012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
10086
10087 * keyboard.c: Export real-this-command to Elisp.
10088 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
10089 and DEFVAR it. Update all users.
10090
63810350
PE
100912012-06-02 Paul Eggert <eggert@cs.ucla.edu>
10092
7bd5c1f4
PE
10093 * minibuf.c (Fassoc_string): Remove duplicate declaration.
10094
63810350
PE
10095 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
10096 Convert pctcpu and pctmem to Lisp float properly.
10097 Let the compiler fold better, as 100.0/0x8000 is exact.
10098
a2821611
AS
100992012-06-02 Andreas Schwab <schwab@linux-m68k.org>
10100
10101 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
10102 cons_block.
10103
5fceba1d
PE
101042012-06-01 Paul Eggert <eggert@cs.ucla.edu>
10105
10106 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
10107
c98ff5dd
DA
101082012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
10109
10110 For a 'struct window', replace some Lisp_Object fields to
10111 bitfields where appropriate, remove unused fields.
10112 * window.h (struct window): Remove unused 'last_mark_x' and
10113 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 10114 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
10115 Change type of 'force_start', 'optional_new_start',
10116 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 10117 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 10118
ca34e0be
PE
101192012-05-31 Paul Eggert <eggert@cs.ucla.edu>
10120
10121 Pacify gcc -Wdouble-precision when using Xaw.
10122 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
10123 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
10124 Use 'float' consistently, rather than 'float' in most places
10125 and 'double' in a couple of places.
10126
efc00ab1 101272012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
10128
10129 * xdisp.c (handle_stop): Detect whether we have overlay strings
10130 loaded by testing it->current.overlay_string_index to be
10131 non-negative, instead of checking whether n_overlay_strings is
10132 positive. (Bug#11587)
10133
efc00ab1 101342012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
10135
10136 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
10137
10138 * doc.c (Fsubstitute_command_keys): Doc fix.
10139
efc00ab1 101402012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
10141
10142 * search.c (search_buffer): Remove calls to
10143 r_alloc_inhibit_buffer_relocation, as it is now called by
10144 maybe_unify_char, which was the cause of relocation of buffer text
10145 in bug#11519.
10146
efc00ab1 101472012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
10148
10149 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
10150 for the duration of call to load_charset, to avoid problems with
10151 callers of maybe_unify_char that access buffer text through C
10152 pointers.
10153
10154 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
10155 decrement the inhibition flag, instead of just setting or
10156 resetting it.
10157
ba93a187
PE
101582012-05-31 Paul Eggert <eggert@cs.ucla.edu>
10159
10160 Remove obsolete '#define static' cruft.
10161 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
10162 This #undef was "temporary" in 2000; it is no longer needed
10163 now that '#define static' has gone away.
10164 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
10165 (gray_bitmap_bits): Remove; no longer needed.
10166 All uses replaced with definiens.
10167 * xterm.c: Include "bitmaps/gray.xbm".
10168
9e4bf381
PE
101692012-05-30 Paul Eggert <eggert@cs.ucla.edu>
10170
10171 Clean up __executable_start, monstartup when --enable-profiling.
10172 The following changes affect the code only when profiling.
10173 * dispnew.c (__executable_start): Rename from safe_bcopy.
10174 Define only on platforms that need it.
10175 * emacs.c: Include <sys/gmon.h> when profiling.
10176 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
10177 (__executable_start): Remove decl, since lisp.h does it now.
10178 (safe_bcopy): Remove decl; no longer has that name.
10179 (main): Coalesce #if into single bit of code, for simplicity.
10180 Cast pointers to uintptr_t, since standard libraries want integers
10181 and not pointers.
10182 * lisp.h (__executable_start): New decl.
10183
32d72c2f
GM
101842012-05-31 Glenn Morris <rgm@gnu.org>
10185
10186 * image.c (Fimagemagick_types): Doc fix.
10187
baac5bc7
JM
101882012-05-30 Jim Meyering <meyering@redhat.com>
10189
10190 * callproc.c (Fcall_process_region): Include directory component
10191 in mkstemp error message (Bug#11586).
10192
72cb32cf
PE
101932012-05-30 Paul Eggert <eggert@cs.ucla.edu>
10194
10195 * alloc.c, lisp.h (make_pure_vector): Now static.
10196
61b108cc
SM
101972012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
10198
10199 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
10200 Move to byte-run.el.
10201 (Fautoload): Do the hash-doc more carefully.
10202 * data.c (Fdefalias): Purify definition, except for keymaps.
10203 (Qdefun): Move from eval.c.
10204 * lisp.h (Qdefun): Remove.
10205 * lread.c (read1): Tiny simplification.
10206
471fe23d
TN
102072012-05-29 Troels Nielsen <bn.troels@gmail.com>
10208
934f3f58 10209 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
10210 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
10211 Bug#9642, but explicitly check that the buffer the overlay would
10212 be moved to is live and rearrange lines to make sure that errors
10213 will not put the overlay in an inconsistent state.
10214 (Fdelete_overlay): Cosmetics.
10215
85d0efd1
EZ
102162012-05-28 Eli Zaretskii <eliz@gnu.org>
10217
10218 * w32term.c (my_bring_window_to_top): New function.
10219 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
10220 could be different from the original one.
10221 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
10222 (Bug#11513)
10223
10224 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
10225 by calling BringWindowToTop.
10226
10227 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
10228 (WM_EMACS_END): Increase by one.
10229
da92a98c
PE
102302012-05-28 Paul Eggert <eggert@cs.ucla.edu>
10231
10232 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
10233 This avoids undefined behavior that might cause the eassert
10234 to not catch an out-of-range value.
10235
74d1f848
JB
102362012-05-28 Juanma Barranquero <lekktu@gmail.com>
10237
10238 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
10239 Update dependencies.
10240
9e1a06fc
EZ
102412012-05-27 Eli Zaretskii <eliz@gnu.org>
10242
10243 * bidi.c (bidi_mirror_char): Fix last change.
10244
f3dd7312
AS
102452012-05-27 Andreas Schwab <schwab@linux-m68k.org>
10246
10247 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
10248 when referring to sectname field in printf format.
10249
81899c91
PE
102502012-05-27 Paul Eggert <eggert@cs.ucla.edu>
10251
57b81a9f
PE
10252 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
10253 Only r_alloc_inhibit_buffer_relocation needed to be added;
10254 the others were already declared.
10255
81899c91
PE
10256 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
10257 before checking whether it's out of range. Put the check inside
10258 eassert. See
10259 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
10260
33017faf 102612012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
10262
10263 * callproc.c (Fcall_process): Restore a line that was accidentally
10264 commented out in the 2011-02-13 change (bug#11547).
10265
33017faf 102662012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
10267
10268 * lisp.h [REL_ALLOC]: Add prototypes for external functions
10269 defined on ralloc.c.
10270
10271 * buffer.c [REL_ALLOC]: Remove prototypes of
10272 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
10273 they are now on lisp.h.
10274
10275 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
10276
10277 * search.c (search_buffer): Use it to inhibit relocation of buffer
10278 text while re_search_2 is doing its job, because re_search_2 is
10279 passed C pointers to buffer text. (Bug#11519)
10280
23415acf
EZ
10281 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
10282 Update value to 24.
10283
44e27368
EZ
10284 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
10285 state after an additional call to move_it_in_display_line_to, keep
10286 the values of it->max_ascent and it->max_descent found for the
10287 entire line.
10288 (pos_visible_p): Revert the comparison against bottom_y to what it
10289 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
10290 (Bug#11464)
10291
c1892f11
PE
102922012-05-26 Paul Eggert <eggert@cs.ucla.edu>
10293
10294 Fix coding-related core dumps with gcc -ftrapv.
10295 The code was computing A - B, where A and B are pointers, and B is
10296 random garbage. This can lead to core dumps on platforms that
10297 have special pointer registers, and it also leads to core dumps on
10298 x86-64 when compiled with gcc -ftrapv. The fix is to compute
10299 A - B only when B is initialized properly.
10300 * coding.c (coding_set_source, coding_set_destination): Return void.
10301 (coding_change_source, coding_change_destinations): New functions,
10302 with the old behaviors of coding_set_source and coding_set_destination.
10303 All callers that need an offset changed to use these new functions.
10304
eb7afdad
GM
103052012-05-26 Glenn Morris <rgm@gnu.org>
10306
10307 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
10308
f12fdf02
EZ
103092012-05-26 Eli Zaretskii <eliz@gnu.org>
10310
53a63be6 10311 Extend mouse support on W32 text-mode console.
61b108cc
SM
10312 * xdisp.c (draw_row_with_mouse_face):
10313 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 10314
eb3f6f01 10315 * w32console.c: Include window.h.
61b108cc
SM
10316 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
10317 New functions.
eb3f6f01
EZ
10318 (initialize_w32_display): Initialize mouse-highlight data.
10319
53a63be6
EZ
10320 * w32inevt.c: Include termchar.h and window.h.
10321 (do_mouse_event): Support mouse-autoselect-window. When the mouse
10322 moves, call note_mouse_highlight. If help_echo changed, call
10323 gen_help_event to produce help-echo message in the echo area.
10324 Call clear_mouse_face if mouse_face_hidden is set in the mouse
10325 highlight info.
10326
4cfd81f6
PE
103272012-05-26 Paul Eggert <eggert@cs.ucla.edu>
10328
10329 * lread.c (read1): Simplify slightly to avoid an overflow warning
10330 with GCC 4.7.0 on x86-64.
10331
4446092a
EZ
103322012-05-26 Eli Zaretskii <eliz@gnu.org>
10333
10334 * bidi.c (bidi_mirror_char): Revert last change: an int is
10335 definitely wide enough here.
10336
42b2a986 103372012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 10338
42b2a986 10339 Fix integer width and related bugs (Bug#9874).
eb106a49 10340 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
10341 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
10342 (string_bytes, check_sblock, allocate_string_data):
10343 (compact_small_strings, Fmake_bool_vector, make_string)
10344 (make_unibyte_string, make_multibyte_string)
10345 (make_string_from_bytes, make_specified_string)
10346 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
10347 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
10348 (mark_vectorlike):
10349 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10350 (allocate_pseudovector):
10351 Use int, not EMACS_INT, where int is wide enough.
10352 (inhibit_garbage_collection, Fgarbage_collect):
10353 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10354 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
10355 int might not be wide enough.
10356 (bidi_cache_search, bidi_cache_find, bidi_init_it)
10357 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
10358 (bidi_at_paragraph_end, bidi_find_paragraph_start)
10359 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
10360 (bidi_level_of_next_char, bidi_move_to_visually_next):
10361 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10362 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
10363 (Fkill_buffer, Fset_buffer_major_mode)
10364 (advance_to_char_boundary, Fbuffer_swap_text)
10365 (Fset_buffer_multibyte, overlays_at, overlays_in)
10366 (overlay_touches_p, struct sortvec, record_overlay_string)
10367 (overlay_strings, recenter_overlay_lists)
10368 (adjust_overlays_for_insert, adjust_overlays_for_delete)
10369 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
10370 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
10371 (Foverlay_recenter, last_overlay_modification_hooks_used)
10372 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
10373 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
10374 (validate_region): Omit unnecessary test for b <= e,
10375 since that's guaranteed by the previous test.
d311d28c
PE
10376 (adjust_overlays_for_delete): Avoid pos + length overflow.
10377 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
10378 (report_overlay_modification):
10379 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10380 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
10381 Omit pointer cast, which isn't needed anyway, and doesn't work
10382 after the EMACS_INT -> ptrdiff_t change.
02481186 10383 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
10384 * buffer.h: Adjust decls to match defn changes elsewhere.
10385 (struct buffer_text, struct buffer):
10386 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10387 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
10388 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
10389 not int, to avoid needless 32-bit limit on 64-bit hosts.
10390 (exec_byte_code): Use tighter memory-full test, one that checks
10391 for alloca overflow. Don't compute the address of the object just
10392 before an array, as that's not portable. Use EMACS_INT, not
10393 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
10394 * callint.c (Fcall_interactively):
10395 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10396 * callproc.c (call_process_kill, Fcall_process):
10397 Don't assume pid_t fits into an Emacs fixnum.
10398 (call_process_cleanup, Fcall_process, child_setup):
10399 Don't assume pid_t fits into int.
10400 (call_process_cleanup, Fcall_process, delete_temp_file)
10401 (Fcall_process_region):
10402 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10403 (Fcall_process): Simplify handling of volatile integers.
10404 Use int, not EMACS_INT, where int will do.
10405 * casefiddle.c (casify_object, casify_region, operate_on_word)
10406 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
10407 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10408 (casify_object): Avoid integer overflow when overallocating buffer.
10409 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 10410 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
10411 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
10412 * category.h (CATEGORYP): Don't assume arg is nonnegative.
10413 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
10414 integers are now checked earlier. All uses replaced with XINT.
10415 (ccl_driver):
10416 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10417 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
10418 (ccl_driver, Fregister_code_conversion_map):
10419 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
10420 (resolve_symbol_ccl_program): Check that vector header is in range.
10421 Always copy the vector, so that we can check its contents reliably
10422 now rather than having to recheck each instruction as it's being
10423 executed. Check that vector words fit in 'int'.
10424 (ccl_get_compiled_code, Fregister_ccl_program)
10425 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
10426 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
10427 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
10428 contents are in range.
10429 (Fccl_execute_on_string): Check that status is in range.
10430 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
10431 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
10432 Accept and return EMACS_INT, not int, because callers can pass values
10433 out of 'int' range.
10434 (c_string_width, strwidth, lisp_string_width, chars_in_text)
10435 (multibyte_chars_in_text, parse_str_as_multibyte)
10436 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
10437 (str_as_unibyte, str_to_unibyte, string_count_byte8)
10438 (string_escape_byte8, Fget_byte):
10439 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 10440 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
10441 avoid mishandling large integers.
10442 * character.h: Adjust decls to match defn changes elsewhere.
10443 * charset.c (load_charset_map_from_file, find_charsets_in_text)
10444 (Ffind_charset_region):
10445 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10446 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
10447 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 10448 Don't assume fixnum fits in int.
d311d28c
PE
10449 (load_charset_map_from_vector, Fmap_charset_chars):
10450 Remove now-unnecessary CHECK_NATNUMs.
10451 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
10452 Don't rely on undefined behavior with signed left shift overflow.
10453 Don't assume unsigned int fits into fixnum, or that fixnum fits
10454 into unsigned int. Don't require max_code to be a valid fixnum;
10455 that's not true for gb10830 4-byte on a 32-bit host. Allow
10456 invalid_code to be a cons, for the same reason. Require code_offset
10457 to be a character. Avoid int overflow if max_char is close
10458 to INT_MAX.
10459 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
10460 this is intended anyway and avoids some undefined behavior.
10461 (load_charset_map): Pass unsigned, not int, as 2nd arg of
10462 INDEX_TO_CODE_POINT, as that's what it expects.
10463 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
10464 * charset.h (DECODE_CHAR): Return int, not unsigned;
10465 this is what was intended anyway, and it avoids undefined behavior.
10466 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
10467 integer-overflow issues.
10468 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
10469 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
10470 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
10471 * chartab.c (Fmake_char_table, Fset_char_table_range)
10472 (uniprop_get_decoder, uniprop_get_encoder):
10473 Don't assume fixnum fits in int.
10474 * cmds.c (move_point): New function, that does the gist of
10475 Fforward_char and Fbackward_char, but does so while checking
10476 for integer overflow more accurately.
c96e5d6a 10477 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
10478 (Fforward_line, Fend_of_line, internal_self_insert)
10479 (internal_self_insert):
10480 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10481 Fix a FIXME, by checking for integer overflow when calculating
10482 target_clm and actual_clm.
10483 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 10484 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
10485 (ASSURE_DESTINATION, coding_alloc_by_realloc)
10486 (coding_alloc_by_making_gap, alloc_destination)
10487 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
10488 (encode_coding_utf_16, detect_coding_emacs_mule)
10489 (decode_coding_emacs_mule, encode_coding_emacs_mule)
10490 (detect_coding_iso_2022, decode_coding_iso_2022)
10491 (encode_invocation_designation, encode_designation_at_bol)
10492 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
10493 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
10494 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
10495 (encode_coding_ccl, encode_coding_raw_text)
10496 (detect_coding_charset, decode_coding_charset)
10497 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
10498 (produce_composition, produce_charset, produce_annotation)
10499 (decode_coding, handle_composition_annotation)
10500 (handle_charset_annotation, consume_chars, decode_coding_gap)
10501 (decode_coding_object, encode_coding_object, detect_coding_system)
10502 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
10503 (code_convert_region, code_convert_string)
8f50130c
PE
10504 (Fdefine_coding_system_internal)
10505 (coding_set_source, coding_set_destination):
d311d28c
PE
10506 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10507 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
10508 (Fdefine_coding_system_internal):
10509 Don't assume fixnums fit in int.
10510 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 10511 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
10512 (Funencodable_char_position, Fcheck_coding_systems_region)
10513 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 10514 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 10515 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 10516 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 10517 Don't access memory outside of the args array.
d311d28c 10518 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
10519 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
10520 result of ENCODE_CHAR.
d311d28c
PE
10521 * coding.h: Adjust decls to match defn changes elsewhere.
10522 (struct coding_system):
10523 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10524 * composite.c (get_composition_id, find_composition)
10525 (run_composition_function, update_compositions)
10526 (compose_text, composition_gstring_put_cache)
10527 (composition_gstring_p, composition_gstring_width)
10528 (fill_gstring_header, fill_gstring_body, autocmp_chars)
10529 (composition_compute_stop_pos, composition_reseat_it)
10530 (composition_update_it, struct position_record)
10531 (find_automatic_composition, composition_adjust_point)
10532 (Fcomposition_get_gstring, Ffind_composition_internal):
10533 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10534 (update_compositions):
10535 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10536 * composite.h: Adjust decls to match defn changes elsewhere.
10537 (struct composition):
10538 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10539 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
10540 Do not attempt to compute the address of the object just before a
10541 buffer; this is not portable.
10542 (Faref, Faset):
10543 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10544 (Faset): Use int, not EMACS_INT, where int is wide enough.
10545 (Fstring_to_number): Don't assume fixnums fit in int.
10546 (Frem): Don't assume arg is nonnegative.
10547 * dbusbind.c (xd_append_arg): Check for integers out of range.
10548 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 10549 (extract_signed, extract_unsigned): New functions.
243e0530
PE
10550 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
10551 (xd_get_connection_references): Return ptrdiff_t, not int.
10552 All uses changed.
10553 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
10554 (xd_read_message_1):
10555 Use int, not unsigned, where the dbus API uses int.
10556 (Fdbus_message_internal): Don't overflow mtype.
10557 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
10558 * dired.c (directory_files_internal, file_name_completion, scmp)
10559 (file_name_completion_stat):
10560 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10561 (file_name_completion): Don't overflow matchcount.
10562 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
10563 * dispextern.h: Adjust decls to match defn changes elsewhere.
10564 (struct text_pos, struct glyph, struct bidi_saved_info)
10565 (struct bidi_string_data, struct bidi_it, struct composition_it)
10566 (struct it):
10567 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10568 (struct display_pos, struct composition_it, struct it):
10569 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10570 * dispnew.c (increment_matrix_positions)
10571 (increment_row_positions, mode_line_string)
10572 (marginal_area_string):
10573 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 10574 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
10575 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10576 (duration_to_sec_usec): New function, to check for overflow better.
10577 (Fsleep_for, sit_for): Use it.
10578 * doc.c (get_doc_string, store_function_docstring):
10579 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10580 (get_doc_string, Fsnarf_documentation):
10581 Use int, not EMACS_INT, where int is wide enough.
10582 (get_doc_string):
10583 Use SAFE_ALLOCA, not alloca.
10584 Check for overflow when converting EMACS_INT to off_t.
10585 * doprnt.c (doprnt):
10586 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10587 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
10588 Don't assume uid_t fits into fixnum.
10589 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
10590 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
10591 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
10592 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
10593 (general_insert_function)
10594 (Finsert_char, make_buffer_string, make_buffer_string_both)
10595 (update_buffer_properties, Fbuffer_substring)
10596 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
10597 (Fsubst_char_in_region, check_translation)
10598 (Ftranslate_region_internal, save_restriction_restore, Fformat)
10599 (transpose_markers, Ftranspose_regions):
10600 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10601 (clip_to_bounds): Move to lisp.h as an inline function).
10602 (Fconstrain_to_field): Don't assume integers are nonnegative.
10603 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
10604 (Fsubst_char_in_region, Fsave_restriction):
10605 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10606 (Femacs_pid): Don't assume pid_t fits into fixnum.
10607 (lo_time): Use int, not EMACS_INT, when int suffices.
10608 (lisp_time_argument): Check for usec out of range.
10609 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
10610 (Fuser_login_name, Fuser_full_name): Signal an error
10611 if a uid argument is out of range, rather than relying on
10612 undefined behavior.
c8d5c857
PE
10613 (Fformat_time_string): Remove now-unnecessary check.
10614 lisp_time_argument checks for out-of-range usec now.
243e0530 10615 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
10616 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
10617 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
10618 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
10619 (init_cmdargs, Fdump_emacs):
10620 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10621 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
10622 the bottom (typically) 32 bits of the fixnum.
10623 * eval.c (specpdl_size, call_debugger):
10624 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10625 (when_entered_debugger, Fbacktrace_debug):
10626 Don't assume fixnum can fit in int.
10627 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
10628 the object just before a buffer; this is not portable.
10629 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
10630 (grow_specpdl, unbind_to):
10631 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10632 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
10633 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 10634 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
10635 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
10636 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
10637 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10638 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
10639 (a_write, e_write):
10640 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10641 (Fcopy_file, non_regular_nbytes, read_non_regular)
10642 (Finsert_file_contents):
10643 Use int, not EMACS_INT, where int is wide enough.
10644 (READ_BUF_SIZE): Verify that it fits in int.
10645 (Finsert_file_contents): Check that counts are in proper range,
10646 rather than assuming fixnums fit into ptrdiff_t etc.
10647 Don't assume fixnums fit into int.
125b3835 10648 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
10649 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
10650 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
10651 (string_char_to_byte, string_byte_to_char)
10652 (string_make_multibyte, string_to_multibyte)
10653 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
10654 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
10655 (substring_both, Fdelete, internal_equal, Ffillarray)
10656 (Fclear_string, mapcar1)
10657 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
10658 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
10659 (larger_vector, make_hash_table, maybe_resize_hash_table)
10660 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
10661 (Fmaphash, secure_hash):
10662 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10663 (concat): Check for string index and length overflow.
10664 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
10665 (Frequire):
10666 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10667 (larger_vector): New API (vec, incr_min, size_max) replaces old
10668 one (vec, new_size, init). This catches size overflow.
10669 INIT was removed because it was always Qnil.
10670 All callers changed.
10671 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
10672 the upper bound on a hash table index size.
10673 (make_hash_table, maybe_resize_hash_table): Use it.
10674 (secure_hash): Computer start_byte and end_byte only after
10675 they're known to be in ptrdiff_t range.
10676 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
10677 (Ffont_get_glyphs, Ffont_at):
10678 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10679 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
10680 (Flist_fonts, Fopen_font):
10681 Don't assume fixnum can fit in int.
10682 (check_gstring): Don't assume index can fit in int.
10683 (font_match_p): Check that fixnum is a character, not a nonnegative
10684 fixnum, since the later code needs to stuff it into an int.
10685 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
10686 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
10687 conversion overflow issues.
10688 (Fopen_font): Check for integer out of range.
10689 (Ffont_get_glyphs): Don't assume index can fit in int.
10690 * font.h: Adjust decls to match defn changes elsewhere.
10691 * fontset.c (reorder_font_vector): Redo score calculation to avoid
10692 integer overflow.
10693 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
10694 printmax_t, where ptrdiff_t is wide enough.
10695 (Finternal_char_font):
10696 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10697 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
10698 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
10699 (Fset_frame_position, x_set_frame_parameters)
10700 (x_set_line_spacing, x_set_border_width)
10701 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
10702 Check that fixnums are in proper range for system types.
10703 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
10704 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10705 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
10706 Use SAFE_ALLOCA_LISP, not alloca.
10707 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
10708 intptr_t is wide enough.
10709 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
10710 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
10711 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
10712 Check for fixnum out of range.
10713 * ftfont.c (ftfont_list): Don't assume index fits in int.
10714 Check that fixnums are in proper range for system types.
10715 (ftfont_shape_by_flt):
10716 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
10717 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
10718 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10719 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
10720 Check that fixnums are in proper range for system types.
10721 * gnutls.h: Adjust decls to match defn changes elsewhere.
10722 * gtkutil.c (xg_dialog_run):
10723 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10724 (update_frame_tool_bar):
10725 Check that fixnums are in proper range for system types.
10726 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 10727 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
10728 * indent.c (last_known_column, last_known_column_point):
10729 (current_column_bol_cache):
10730 (skip_invisible, current_column, check_display_width):
10731 (check_display_width, scan_for_column, current_column_1)
10732 (Findent_to, Fcurrent_indentation, position_indentation)
10733 (indented_beyond_p, Fmove_to_column, compute_motion):
10734 (Fcompute_motion, Fvertical_motion):
10735 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10736 (last_known_column_modified): Use EMACS_INT, not int.
10737 (check_display_width):
10738 (Fcompute_motion):
10739 Check that fixnums and floats are in proper range for system types.
10740 (compute_motion): Don't assume index or fixnum fits in int.
10741 (compute_motion, Fcompute_motion):
10742 Use int, not EMACS_INT, when it is wide enough.
10743 (vmotion): Omit local var start_hpos that is always 0; that way
10744 we don't need to worry about overflow in expressions involving it.
10745 * indent.h: Adjust decls to match defn changes elsewhere.
10746 (struct position):
10747 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10748 Use int, not EMACS_INT, where int is wide enough.
10749 Remove unused members ovstring_chars_done and tab_offset;
10750 all uses removed.
10751 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
10752 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
10753 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
10754 (make_gap, copy_text, insert, insert_and_inherit)
10755 (insert_before_markers, insert_before_markers_and_inherit)
10756 (insert_1, count_combining_before, count_combining_after)
10757 (insert_1_both, insert_from_string)
10758 (insert_from_string_before_markers, insert_from_string_1)
10759 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
10760 (adjust_after_replace, adjust_after_insert, replace_range)
10761 (replace_range_2, del_range, del_range_1, del_range_byte)
10762 (del_range_both, del_range_2, modify_region)
10763 (prepare_to_modify_buffer, signal_before_change)
10764 (signal_after_change, Fcombine_after_change_execute):
10765 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10766 * intervals.c (traverse_intervals, rotate_right, rotate_left)
10767 (balance_an_interval, split_interval_right, split_interval_left)
10768 (find_interval, next_interval, update_interval)
10769 (adjust_intervals_for_insertion, delete_node, delete_interval)
10770 (interval_deletion_adjustment, adjust_intervals_for_deletion)
10771 (static_offset_intervals, offset_intervals)
10772 (merge_interval_right, merge_interval_left, make_new_interval)
10773 (graft_intervals_into_buffer, temp_set_point_both)
10774 (temp_set_point, set_point, adjust_for_invis_intang)
10775 (set_point_both, move_if_not_intangible, get_property_and_range)
10776 (get_local_map, copy_intervals, copy_intervals_to_string)
10777 (compare_string_intervals, set_intervals_multibyte_1):
10778 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10779 * intervals.h: Adjust decls to match defn changes elsewhere.
10780 (struct interval):
10781 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10782 * keyboard.c (this_command_key_count, this_single_command_key_start)
10783 (before_command_key_count, before_command_echo_length, echo_now)
10784 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
10785 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
10786 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
10787 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
10788 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10789 (last_non_minibuf_size, last_point_position, echo_truncate)
10790 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
10791 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
10792 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
10793 (stuff_buffered_input):
10794 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10795 (last_auto_save, command_loop_1, read_char):
10796 Use EMACS_INT, not int, to avoid integer overflow.
10797 (record_char): Avoid overflow in total_keys computation.
10798 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
10799 * keyboard.h: Adjust decls to match defn changes elsewhere.
10800 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
10801 (Fkey_description, Fdescribe_vector, Flookup_key):
10802 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10803 (click_position): New function, to check that positions are in range.
10804 (Fcurrent_active_maps):
10805 (describe_command):
10806 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10807 (Faccessible_keymaps, Fkey_description):
10808 (preferred_sequence_p):
10809 Don't assume fixnum can fit into int.
10810 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
10811 Check for integer overflow in size calculations.
10812 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
10813 avoid mishandling large integers.
10814 * lisp.h: Adjust decls to match defn changes elsewhere.
10815 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
10816 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
10817 (struct Lisp_Marker):
10818 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10819 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
10820 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
10821 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
10822 All callers changed.
10823 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
10824 Assume the arg has valid form, since it always does.
10825 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
10826 unsigned integer system type.
10827 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
10828 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
10829 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10830 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
10831 (duration_to_sec_usec): New decl.
10832 * lread.c (read_from_string_index, read_from_string_index_byte)
10833 (read_from_string_limit, readchar, unreadchar, openp)
10834 (read_internal_start, read1, oblookup):
10835 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10836 (Fload, readevalloop, Feval_buffer, Feval_region):
10837 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10838 (openp): Check for out-of-range argument to 'access'.
10839 (read1): Use int, not EMACS_INT, where int is wide enough.
10840 Don't assume fixnum fits into int.
6efdadfd 10841 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
10842 (read_filtered_event): Use duration_to_sec_usec
10843 to do proper overflow checking on durations.
d311d28c
PE
10844 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
10845 in size calculation.
10846 (Fexecute_kbd_macro):
10847 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10848 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
10849 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
10850 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
10851 (set_marker_both, set_marker_restricted_both, marker_position)
10852 (marker_byte_position, Fbuffer_has_markers_at):
10853 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10854 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 10855 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
10856 It now merely ensures that the menu is large enough, without
10857 necessarily growing it, as this avoids some integer overflow issues.
10858 All callers changed.
10859 (keymap_panes, parse_single_submenu, Fx_popup_menu):
10860 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10861 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
10862 Use SAFE_ALLOCA_LISP, not alloca.
10863 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
10864 to EMACS_INT. Check that fixnums are in proper range for system types.
10865 * minibuf.c (minibuf_prompt_width, string_to_object)
10866 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
10867 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
10868 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10869 (get_minibuffer, read_minibuf_unwind):
10870 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10871 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
10872 this simplifies overflow checking. All callers changed.
10873 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
10874 (Ftest_completion):
10875 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10876 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
10877 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
10878 Check that fixnums are in proper range for system types.
10879 (Fx_create_frame, Fx_show_tip):
10880 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10881 * nsfont.m (ns_findfonts, nsfont_list_family):
10882 Don't assume fixnum fits in long.
10883 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
10884 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10885 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
10886 wide enough.
17fdb222 10887 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
10888 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10889 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
10890 (PRINTDECLARE, PRINTPREPARE):
10891 (strout, print_string):
10892 (print, print_preprocess, print_check_string_charset_prop)
10893 (print_object):
10894 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10895 (PRINTDECLARE):
10896 (temp_output_buffer_setup, Fprin1_to_string, print_object):
10897 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10898 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 10899 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 10900 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
10901 (print_error_message): Use SAFE_ALLOCA, not alloca.
10902 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
10903 (print_depth, new_backquote_output, print_number_index):
10904 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
10905 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
10906 (Fset_process_window_size, Fformat_network_address)
10907 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 10908 (sigchld_handler):
d311d28c 10909 Check that fixnums are in proper range for system types.
d44287d4 10910 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
10911 Check for process-ids out of pid_t range rather than relying on
10912 undefined behavior.
e4d81efc 10913 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
10914 (Fformat_network_address, read_process_output, send_process)
10915 (Fprocess_send_region, status_notify):
10916 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10917 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
10918 (wait_reading_process_output, read_process_output, exec_sentinel):
10919 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10920 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
10921 (Faccept_process_output): Use duration_to_sec_usec to do proper
10922 overflow checking on durations.
dde14581
PE
10923 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
10924 Don't assume pid_t fits in int.
02481186
PE
10925 * process.h (struct Lisp_Process): Members tick and update_tick
10926 are now of type EMACS_INT, not int.
b62b53e8
PE
10927 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
10928 configured --with-wide-int.
d311d28c
PE
10929 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
10930 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
10931 * search.c (looking_at_1, string_match_1):
10932 (fast_string_match, fast_c_string_match_ignore_case)
10933 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
10934 (scan_newline, find_before_next_newline, search_command)
10935 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
10936 (set_search_regs, wordify):
10937 (Freplace_match):
10938 (Fmatch_data):
10939 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10940 (string_match_1, search_buffer, set_search_regs):
10941 (Fmatch_data):
10942 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10943 (wordify): Check for overflow in size calculation.
10944 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
10945 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
10946 Check that fixnums are in proper range for system types.
10947 * sound.c (struct sound_device)
10948 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
10949 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10950 (Fplay_sound_internal):
10951 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 10952 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
10953 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
10954 (Fparse_partial_sexp):
10955 Don't assume fixnums can fit in int.
10956 (struct lisp_parse_state, find_start_pos, find_start_value)
10957 (find_start_value_byte, find_start_begv)
10958 (update_syntax_table, char_quoted, dec_bytepos)
10959 (find_defun_start, prev_char_comend_first, back_comment):
10960 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
10961 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
10962 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10963 (Finternal_describe_syntax_value): Check that match_lisp is a
10964 character, not an integer, since the code stuffs it into int.
10965 (scan_words, scan_sexps_forward):
10966 Check that fixnums are in proper range for system types.
10967 (Fforward_word):
10968 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10969 (scan_sexps_forward):
10970 Use CHARACTERP, not INTEGERP, since the value must fit into int.
10971 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
10972 * syntax.h: Adjust decls to match defn changes elsewhere.
10973 (struct gl_state_s):
10974 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
10975 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
10976 MOST_POSITIVE_FIXNUM.
d311d28c
PE
10977 * sysdep.c (wait_for_termination_1, wait_for_termination)
10978 (interruptible_wait_for_termination, mkdir):
10979 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
10980 (emacs_read, emacs_write):
10981 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
10982 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
10983 and double all fit in int.
d311d28c
PE
10984 * term.c (set_tty_color_mode):
10985 Check that fixnums are in proper range for system types.
10986 * termhooks.h (struct input_event):
10987 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10988 * textprop.c (validate_interval_range, interval_of)
10989 (Fadd_text_properties, set_text_properties_1)
10990 (Fremove_text_properties, Fremove_list_of_text_properties)
10991 (Ftext_property_any, Ftext_property_not_all)
10992 (copy_text_properties, text_property_list, extend_property_ranges)
10993 (verify_interval_modification):
10994 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10995 (Fnext_single_char_property_change)
10996 (Fprevious_single_char_property_change):
10997 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
10998 (copy_text_properties):
10999 Check for integer overflow in index calculation.
d311d28c
PE
11000 * undo.c (last_boundary_position, record_point, record_insert)
11001 (record_delete, record_marker_adjustment, record_change)
11002 (record_property_change):
11003 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11004 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
11005 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11006 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
11007 (Fx_hide_tip, Fx_file_dialog):
11008 * w32menu.c (set_frame_menubar):
11009 Use ptrdiff_t, not int, for consistency with rest of code.
11010 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
11011 (select_window, Fdelete_other_windows_internal)
11012 (window_scroll_pixel_based, window_scroll_line_based)
11013 (Frecenter, Fset_window_configuration):
11014 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11015 (Fset_window_hscroll, run_window_configuration_change_hook)
11016 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 11017 (Fscroll_other_window, Frecenter):
d311d28c
PE
11018 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11019 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
11020 Don't assume fixnum fits in int.
11021 (Fset_window_scroll_bars):
11022 Check that fixnums are in proper range for system types.
11023 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
11024 (string_pos, c_string_pos, number_of_chars, init_iterator)
11025 (in_ellipses_for_invisible_text_p, init_from_display_pos)
11026 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
11027 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
11028 (face_before_or_after_it_pos, handle_invisible_prop)
11029 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
11030 (display_prop_intangible_p, string_buffer_position_lim)
11031 (string_buffer_position, handle_composition_prop, load_overlay_strings)
11032 (get_overlay_strings_1, get_overlay_strings)
11033 (iterate_out_of_display_property, forward_to_next_line_start)
11034 (back_to_previous_visible_line_start, reseat, reseat_to_string)
11035 (get_next_display_element, set_iterator_to_next)
11036 (get_visually_first_element, compute_stop_pos_backwards)
11037 (handle_stop_backwards, next_element_from_buffer)
11038 (move_it_in_display_line_to, move_it_in_display_line)
11039 (move_it_to, move_it_vertically_backward, move_it_by_lines)
11040 (add_to_log, message_dolog, message_log_check_duplicate)
11041 (message2, message2_nolog, message3, message3_nolog
11042 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
11043 (current_message_1, truncate_echo_area, truncate_message_1)
11044 (set_message, set_message_1, store_mode_line_noprop)
11045 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
11046 (text_outside_line_unchanged_p, check_point_in_composition)
11047 (reconsider_clip_changes)
11048 (redisplay_internal, set_cursor_from_row, try_scrolling)
11049 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
11050 (redisplay_window, find_last_unchanged_at_beg_row)
11051 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
11052 (trailing_whitespace_p, find_row_edges, display_line)
11053 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
11054 (display_mode_element, store_mode_line_string)
11055 (pint2str, pint2hrstr, decode_mode_spec)
11056 (display_count_lines, display_string, draw_glyphs)
11057 (x_produce_glyphs, x_insert_glyphs)
11058 (rows_from_pos_range, mouse_face_from_buffer_pos)
11059 (fast_find_string_pos, mouse_face_from_string_pos)
11060 (note_mode_line_or_margin_highlight, note_mouse_highlight):
11061 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11062 (safe_call, init_from_display_pos, handle_fontified_prop)
11063 (handle_single_display_spec, load_overlay_strings)
11064 (with_echo_area_buffer, setup_echo_area_for_printing)
11065 (display_echo_area, echo_area_display)
11066 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
11067 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
11068 (redisplay_window, dump_glyph_row, display_mode_line)
11069 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 11070 (handle_display_spec, display_prop_string_p):
d311d28c
PE
11071 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11072 (handle_single_display_spec, build_desired_tool_bar_string)
11073 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
11074 (get_specified_cursor_type):
11075 Check that fixnums are in proper range for system types.
11076 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
11077 (Flookup_image_map):
11078 Don't assume fixnums fit in int.
11079 (compare_overlay_entries):
11080 Avoid mishandling comparisons due to subtraction overflow.
11081 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
11082 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
11083 (handle_tool_bar_click):
11084 Use int, not unsigned, since we prefer signed and the signedness
11085 doesn't matter here.
11086 (get_next_display_element, next_element_from_display_vector):
11087 Use int, not EMACS_INT, when int is wide enough.
11088 (start_hourglass): Use duration_to_sec_usec to do proper
11089 overflow checking on durations.
11090 * xfaces.c (Fbitmap_spec_p):
11091 Check that fixnums are in proper range for system types.
11092 (compare_fonts_by_sort_order):
11093 Avoid mishandling comparisons due to subtraction overflow.
11094 (Fx_family_fonts, realize_basic_faces):
11095 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11096 (Fx_family_fonts):
11097 Don't assume fixnum fits in int.
11098 Use SAFE_ALLOCA_LISP, not alloca.
11099 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
11100 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
11101 (face_at_buffer_position, face_for_overlay_string)
11102 (face_at_string_position):
11103 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11104 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
11105 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
11106 (Fx_show_tip):
11107 Check that fixnums are in proper range for system types.
11108 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
11109 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
11110 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11111 (Fx_change_window_property): Don't assume fixnums fit in int.
11112 * xfont.c (xfont_chars_supported):
11113 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11114 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
11115 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
11116 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11117 * xml.c (parse_region):
11118 * xrdb.c (magic_file_p):
11119 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11120 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
11121 (x_get_local_selection, x_reply_selection_request)
11122 (x_handle_selection_request, wait_for_property_change):
11123 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11124 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
11125 short is wide enough.
11126 (x_send_client_event): Don't assume fixnum fits in int.
11127 * xterm.c (x_x_to_emacs_modifiers):
11128 Don't assume EMACS_INT overflows nicely into int.
11129 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
11130 may come from Lisp.
11131 (handle_one_xevent): NATNUMP can eval its arg twice.
11132 (x_connection_closed):
11133 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11134 * xterm.h: Adjust decls to match defn changes elsewhere.
11135 (struct scroll_bar): Use struct vectorlike_header
11136 rather than rolling our own approximation.
11137 (SCROLL_BAR_VEC_SIZE): Remove; not used.
11138
c6574eb5
GM
111392012-05-25 Glenn Morris <rgm@gnu.org>
11140
11141 * lisp.mk (lisp): Update for more files being compiled now.
11142
e8d32c7e
SM
111432012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
11144
48def666
SM
11145 * lread.c: Remove `read_pure' which makes no difference.
11146 (read_pure): Remove var.
11147 (unreadpure): Remove function.
11148 (readevalloop): Don't call read_list with -1 flag.
11149 (read1, read_vector): Don't test read_pure any more.
11150 (read_list): Simplify.
11151
e8d32c7e
SM
11152 * fileio.c, character.h: Minor style tweaks.
11153
4b2addb7
DA
111542012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
11155
11156 * window.h (clip_changed): Remove useless declaration.
11157
584461b2
JB
111582012-05-22 Juanma Barranquero <lekktu@gmail.com>
11159
11160 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
11161 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
11162
34374650
PE
111632012-05-22 Paul Eggert <eggert@cs.ucla.edu>
11164
11165 Remove src/m/*.
11166 This directory predates autoconf and is no longer needed nowadays.
11167 Move its few remaining bits of functionality to where they're needed.
11168 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
11169 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
11170 * m/template.h: Remove.
11171 * Makefile.in (M_FILE): Remove. All uses removed.
11172 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
11173 * lisp.h (USE_LSB_TAG):
11174 * mem-limits.h (EXCEEDS_LISP_PTR):
11175 Use VAL_MAX, not VALBITS, in #if.
11176 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
11177 (EMACS_UINT): Define unconditionally now.
11178 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
11179 (BITS_PER_EMACS_INT): New constants, replacing
11180 what used to be in config.h, but not useful in #if.
11181 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
11182 define them any more.
11183 (VAL_MAX): New macro.
11184 (VALMASK): Use it.
11185 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
11186 BITS_PER_EMACS_INT, in #if.
11187 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
11188 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
11189 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
11190 * s/ms-w32.h (DATA_START):
11191 Move here from removed file m/intel386.h.
11192 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
11193 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
11194
261cb4bb
PE
111952012-05-21 Paul Eggert <eggert@cs.ucla.edu>
11196
11197 Assume C89 or later.
11198 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
11199 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
11200 (xrealloc):
11201 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
11202 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
11203 * textprop.c, tparam.c (NULL): Remove.
11204 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
11205 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
11206 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
11207 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
11208 * xterm.c (input_signal_count): Assume volatile works.
11209
ff23cd9f
KB
112102012-05-21 Ken Brown <kbrown@cornell.edu>
11211
11212 * xgselect.c (xg_select): Fix first argument in call to 'select'
11213 (bug#11508).
11214
1b170bc6
KB
112152012-05-20 Ken Brown <kbrown@cornell.edu>
11216
11217 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 11218 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 11219
b2f4d39f
KB
112202012-05-19 Ken Brown <kbrown@cornell.edu>
11221
11222 * xfns.c (x_in_use): Remove `static' qualifier.
11223 * xterm.h (x_in_use): Declare.
11224 * xgselect.c: Include xterm.h.
11225 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
11226 and `display_arg' (bug#9754).
11227
003fdae2
PE
112282012-05-19 Paul Eggert <eggert@cs.ucla.edu>
11229
9232a6d9
PE
11230 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
11231
003fdae2
PE
11232 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
11233 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
11234
784b56e2
EZ
112352012-05-18 Eli Zaretskii <eliz@gnu.org>
11236
11237 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
11238
11239 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 11240 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
11241
11242 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
11243 reference to image_cache->refcount.
11244 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
11245
a0a79cde
JL
112462012-05-17 Juri Linkov <juri@jurta.org>
11247
11248 * search.c (Fword_search_regexp, Fword_search_backward)
11249 (Fword_search_forward, Fword_search_backward_lax)
11250 (Fword_search_forward_lax): Move functions to isearch.el
11251 (bug#10145, bug#11381).
11252
b0572523
PE
112532012-05-16 Paul Eggert <eggert@cs.ucla.edu>
11254
11255 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
11256
9660f5fc
SM
112572012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
11258
11259 * lread.c (init_obarray): Declare Qt and Qnil as special.
11260
4374de83
GM
112612012-05-14 Glenn Morris <rgm@gnu.org>
11262
11263 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 11264 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 11265
dc44c39a
PE
112662012-05-14 Paul Eggert <eggert@cs.ucla.edu>
11267
078c97cb
PE
11268 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
11269
dc44c39a
PE
11270 * unexaix.c: Port to more-recent AIX compilers.
11271 (report_error, report_error_1, make_hdr, copy_sym)
11272 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
11273 Make arguments const char *, not char *, to avoid violations of C
11274 standard and to fix some AIX warnings reported by Gilles Pion.
11275
e18afed7 112762012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
11277
11278 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
11279 already have overlays loaded.
11280 (handle_single_display_spec): Before returning without displaying
11281 fringe bitmap, synchronize the bidi iterator with the main display
11282 iterator, by calling iterate_out_of_display_property.
11283 (iterate_out_of_display_property): Detect buffer iteration by
11284 testing that it->string is a Lisp string.
11285 (get_next_display_element): When the current object is exhausted,
11286 and there's something on it->stack, call set_iterator_to_next to
11287 proceed with what's on the stack, instead of returning zero.
11288 (set_iterator_to_next): If called at the end of a Lisp string,
11289 proceed to consider_string_end without incrementing string
11290 position. Don't increment display vector index past the end of
11291 the display vector. (Bug#11417)
c8fb9dc6
EZ
11292 (pos_visible_p): Don't report a position visible when move_it_to
11293 stopped at the last line of window, which happens to be scanned
11294 backwards by the bidi iteration. (Bug#11464)
ac268e67 11295
e18afed7 112962012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
11297
11298 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
11299 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
11300 are on a TTY, and thus unable to display on the fringes.
11301 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
11302 so we need to signal to the caller that this is a "replacing"
11303 display spec. This fixes display when the spec is invalid or we
11304 are on a TTY.
11305
e18afed7 113062012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
11307
11308 * unexaix.c (make_hdr): Fix typo in prototype.
11309 This bug broke the build on AIX. Problem reported by Gilles Pion.
11310
9d0a235a
MA
113112012-05-14 Michael Albinus <michael.albinus@gmx.de>
11312
11313 * keyboard.c (kbd_buffer_get_event): Read special events also in
11314 batch mode. (Bug#11415)
11315
9e6b06ed
GM
113162012-05-12 Glenn Morris <rgm@gnu.org>
11317
11318 * ns.mk: Update for ns_appbindir no longer having trailing "/".
11319
c1a1d7a3
EZ
113202012-05-12 Eli Zaretskii <eliz@gnu.org>
11321
11322 * lisp.mk (lisp): Add newcomment.elc.
11323
3fe7cdc8
GM
113242012-05-12 Glenn Morris <rgm@gnu.org>
11325
11326 * Makefile.in (MKDIR_P): New, set by configure.
11327 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
11328
53f7d2c0
PE
113292012-05-11 Paul Eggert <eggert@cs.ucla.edu>
11330
11331 Remove unused function hourglass_started.
11332 * dispextern.h (hourglass_started):
11333 * w32fns.c (hourglass_started):
11334 * xdisp.c (hourglass_started): Remove.
11335
75aafb17
JB
113362012-05-10 Juanma Barranquero <lekktu@gmail.com>
11337
11338 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
11339 Update dependencies.
11340
12959e8e
PE
113412012-05-10 Paul Eggert <eggert@cs.ucla.edu>
11342
97107e2e
PE
11343 * xgselect.c (xg_select): Put maxfds+1 into a var.
11344 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
11345
12959e8e
PE
11346 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
11347
836d29b3
DA
113482012-05-10 Dave Abrahams <dave@boostpro.com>
11349
11350 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
11351 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
11352
5cb67954
MA
113532012-05-09 Michael Albinus <michael.albinus@gmx.de>
11354
11355 * dbusbind.c (xd_registered_buses): New internal Lisp object.
cccaebd2 11356 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
5cb67954
MA
11357 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
11358 Initialize xd_registered_buses.
11359
3478ec45
PE
113602012-05-09 Paul Eggert <eggert@cs.ucla.edu>
11361
b263a6b0
PE
11362 Untag more efficiently if USE_LSB_TAG.
11363 This is based on a proposal by YAMAMOTO Mitsuharu in
11364 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
11365 For an admittedly artificial (nth 8000 longlist) benchmark on
11366 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
11367 Emacs's overall text size by 1%.
11368 * lisp.h (XUNTAG): New macro.
11369 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
11370 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
11371 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
11372 * eval.c (Fautoload):
11373 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
11374 * frame.h (XFRAME): Use XUNTAG.
11375
3478ec45
PE
11376 Port recent dbusbind.c changes to 32-bit --with-wide-int.
11377 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
11378 Remove unportable assumptions about print widths of types like
11379 dbus_uint32_t.
11380 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
11381 intptr_t when converting between pointer and integer, to avoid GCC
11382 warnings about wrong width.
11383
666b903b 113842012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
11385
11386 * w32proc.c (new_child): Force Windows to reserve only 64KB of
11387 stack for each reader_thread, instead of defaulting to 8MB
11388 determined by the linker. This avoids failures in creating
11389 subprocesses on Windows 7, see the discussion in this thread:
11390 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
11391
b120cc17
JC
113922012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
11393
11394 Fix up display of the *Minibuf-0* buffer in the mini window.
11395 * keyboard.c (read_char): Don't clear the echo area if there's no
11396 message to clear.
11397 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 11398 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 11399
9a4b36f8
MA
114002012-05-07 Michael Albinus <michael.albinus@gmx.de>
11401
11402 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
11403 batch mode.
11404
e5f9458f
CY
114052012-05-06 Chong Yidong <cyd@gnu.org>
11406
11407 * lisp.mk (lisp): Update.
11408
eceeb5fc 114092012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
11410
11411 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
11412
71873e2b
SM
114132012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
11414
11415 * data.c (PUT_ERROR): New macro.
11416 (syms_of_data): Use it. Add new error type `user-error'.
11417 * undo.c (user_error): New function.
11418 (Fprimitive_undo): Use it.
11419 * print.c (print_error_message): Adjust print style for `user-error'.
11420 * keyboard.c (user_error): New function.
11421 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
11422
ab0fa4e4
PE
114232012-05-03 Paul Eggert <eggert@cs.ucla.edu>
11424
11425 Do not limit current-time-string to years 1000..9999.
11426 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
11427 (Fcurrent_time_string): Support any year that is supported by the
11428 underlying localtime representation. Don't use asctime, as it
11429 has undefined behavior for years outside the range -999..9999.
11430
7ed806a7
PE
114312012-05-02 Paul Eggert <eggert@cs.ucla.edu>
11432
11433 Fix race conditions involving setenv, gmtime, localtime, asctime.
11434 Without this fix, interrupts could mess up code that uses these
11435 nonreentrant functions, since setting TZ invalidates existing
11436 tm_zone or tzname values, and since most of these functions return
11437 pointers to static storage.
11438 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
11439 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
11440 Grow the critical sections to include not just invoking
11441 localtime/gmtime, but also accessing these functions' results
11442 including their tm_zone values if any, and any related TZ setting.
11443 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
11444 so that the struct tm is saved in the critical section.
11445 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
11446 motivated by the fact that memory allocation needs to be outside
11447 the critical section.
11448
0c16dfed
DA
114492012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
11450
11451 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
11452 with RESET_INTERVAL.
11453
11454 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
11455 Remove duplicated buffer name initialization.
11456
3f83ace8
JM
114572012-05-02 Jim Meyering <jim@meyering.net>
11458
11459 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
11460
c7b8541e
JM
11461 * xfns.c (x_window): Use xstrdup (Bug#11375).
11462
90207a15 114632012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
11464
11465 * xdisp.c (pos_visible_p): If already at a newline from the
11466 display string before the 'while' loop, don't walk back the glyphs
11467 from it3.glyph_row. Solves assertion violation when the display
11468 string begins with a newline (egg.el). (Bug#11367)
11469
b593d6a9
AH
114702012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
11471
11472 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
11473 Move to simple.el.
11474
4737362e
GM
114752012-05-01 Glenn Morris <rgm@gnu.org>
11476
99cf43f9
GM
11477 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
11478 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
11479 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
11480 All were removed before 23.1.
11481
9311dcff
GM
11482 * dispnew.c: Remove HAVE_LIBNCURSES test;
11483 it is always true on relevant platforms.
11484
4d5c6349
GM
11485 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
11486 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
11487
4737362e
GM
11488 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
11489
74dd3a6b
AS
114902012-04-30 Andreas Schwab <schwab@linux-m68k.org>
11491
11492 * .gdbinit (xpr): Remove checks for no longer existing misc types.
11493 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
11494 Remove.
11495
13c379ee
PE
114962012-04-28 Paul Eggert <eggert@cs.ucla.edu>
11497
11498 Do not avoid creating empty evaporating overlays (Bug#9642).
11499 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
11500 That is, do not delete an evaporating overlay if it becomes
11501 empty after its bounds are adjusted to fit within its buffer.
11502 This fix caused other problems, and I'm reverting it until we get
11503 to the bottom of them.
11504
a8e7d6d7 115052012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
11506
11507 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
11508
a8e7d6d7 115092012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
11510
11511 * xdisp.c (pos_visible_p): If the window start position is beyond
11512 ZV, start the display from buffer beginning. Prevents assertion
11513 violation in init_iterator when the minibuffer window is scrolled
11514 via the scroll bar.
11515
11516 * window.c (window_scroll_pixel_based): Likewise.
11517
a8e7d6d7 115182012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
11519
11520 * keymap.c (where_is_internal): Doc fix (Bug#10872).
11521
a8e7d6d7 115222012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
11523
11524 * fileio.c (Fcopy_file, Fset_file_selinux_context):
11525 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
11526
a8e7d6d7 115272012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 11528
b593d6a9
AH
11529 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
11530 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 11531
1c6900d9
EZ
115322012-04-26 Eli Zaretskii <eliz@gnu.org>
11533
4c3fa1d9
EZ
11534 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
11535 display element, check also the underlying string or buffer
11536 character. (Bug#11341)
11537
1c6900d9
EZ
11538 * w32menu.c: Include w32heap.h.
11539 (add_menu_item): If the call to AppendMenuW (via
11540 unicode_append_menu) fails, disable Unicode menus only if we are
11541 running on Windows 9X/Me.
11542
42bf8205
AS
115432012-04-24 Andreas Schwab <schwab@linux-m68k.org>
11544
11545 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
11546 (xgetint): Add missing shift for LSB tags.
11547
b1bac16e
MR
115482012-04-24 Martin Rudalics <rudalics@gmx.at>
11549
11550 * keyboard.c (read_char): Don't wipe echo area for select window
11551 events: These might get delayed via `mouse-autoselect-window'
11552 (Bug#11304).
11553
d69621cc
JB
115542012-04-24 Juanma Barranquero <lekktu@gmail.com>
11555
11556 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
11557 manipulation of :loaded-from data.
11558
02fd101b
JB
115592012-04-23 Juanma Barranquero <lekktu@gmail.com>
11560
11561 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
11562 now a cons (bug#11311).
11563
888bec30
PE
115642012-04-23 Paul Eggert <eggert@cs.ucla.edu>
11565
89a438bd
PE
11566 Do not create empty overlays with the evaporate property (Bug#9642).
11567 * buffer.c (Fmove_overlay): Delete an evaporating overlay
11568 if it becomes empty after its bounds are adjusted to fit within
11569 its buffer. Without this fix, in a nonempty buffer (let ((o
11570 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
11571 yields an empty overlay that has the evaporate property, which is
11572 not supposed to happen.
11573
1068fe4d
PE
11574 Fix minor GTK3 problems found by static checking.
11575 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
11576 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
11577 (struct _EmacsFixedClass, emacs_fixed_get_type):
11578 Move decls here from emacsgtkfixed.h, since they needn't be public.
11579 (emacs_fixed_get_type): Now static.
11580 (emacs_fixed_class_init): Omit unused local.
11581 (emacs_fixed_child_type): Remove; unused.
11582 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
11583 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
11584 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
11585 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
11586 (EMACS_FIXED_GET_CLASS): Remove; unused.
11587 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
11588
888bec30
PE
11589 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
11590 Problem reported by Juanma Barranquero for Windows -Wunused-function.
11591
de85e130
PE
115922012-04-22 Paul Eggert <eggert@cs.ucla.edu>
11593
d0baac98 11594 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 11595 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
11596 (__malloc_size_t, __malloc_ptrdiff_t):
11597 Remove. All uses removed, replaced by the definiens if needed,
11598 since we can assume C89 or better now.
11599 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
11600 (protect_malloc_state, align, get_contiguous_space)
11601 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
11602 (malloc_atfork_handler_child, malloc_enable_thread)
11603 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
11604 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
11605 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
11606 (special_realloc, _realloc_internal_nolock, _realloc_internal)
11607 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
11608 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
11609 Define using prototypes, not old style.
11610 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
11611 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
11612 (align): Don't assume that signed integer overflow wraps around.
11613 Omit unused local var.
11614 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
11615 (_free_internal_nolock, memalign, mallochook, reallochook):
11616 Omit no-longer-needed casts.
11617 (valloc): Use getpagesize, not __getpagesize.
11618 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
11619 (struct hdr): The 'magic' member is now size_t, not unsigned long.
11620
de85e130
PE
11621 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
11622
dcbf5805
MA
116232012-04-22 Michael Albinus <michael.albinus@gmx.de>
11624
11625 Move functions from C to Lisp. Make non-blocking method calls
11626 the default. Implement further D-Bus standard interfaces.
11627
11628 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
11629 (QCdbus_request_name_allow_replacement)
11630 (QCdbus_request_name_replace_existing)
11631 (QCdbus_request_name_do_not_queue)
11632 (QCdbus_request_name_reply_primary_owner)
11633 (QCdbus_request_name_reply_in_queue)
11634 (QCdbus_request_name_reply_exists)
11635 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
11636 (QCdbus_registered_serial, QCdbus_registered_method)
11637 (QCdbus_registered_signal): New Lisp objects.
11638 (XD_DEBUG_MESSAGE): Use sizeof.
11639 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
11640 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
11641 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
11642 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
11643 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
11644 (xd_signature, xd_append_arg): Allow float for integer types.
11645 (xd_get_connection_references): New function.
b593d6a9
AH
11646 (xd_get_connection_address): Rename from xd_initialize.
11647 Return cached address.
dcbf5805
MA
11648 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
11649 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
11650 level.
11651 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 11652 Return number of refcounts.
dcbf5805
MA
11653 (Fdbus_get_unique_name): Make stronger parameter check.
11654 (Fdbus_message_internal): New defun.
11655 (Fdbus_call_method, Fdbus_call_method_asynchronously)
11656 (Fdbus_method_return_internal, Fdbus_method_error_internal)
11657 (Fdbus_send_signal, Fdbus_register_service)
11658 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
11659 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
11660 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
11661 (Vdbus_compiled_version, Vdbus_runtime_version)
11662 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
11663 (Vdbus_message_type_method_return, Vdbus_message_type_error)
11664 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
11665 (Vdbus_registered_buses, Vdbus_registered_objects_table):
11666 Adapt docstring.
dcbf5805 11667
52828e02
PE
116682012-04-22 Paul Eggert <eggert@cs.ucla.edu>
11669
da05bc4c
PE
11670 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
11671 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
11672 Do not assume ptrdiff_t is the same width as 'int'.
11673
52828e02
PE
11674 * alloc.c: Handle unusual debugging option combinations.
11675 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
11676 since the two debugging options are incompatible.
11677 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
11678 is defined.
11679 (mem_init, mem_insert, mem_insert_fixup):
11680 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
11681 (NEED_MEM_INSERT): Remove; no longer needed.
11682
f01769f9
LL
116832012-04-22 Leo Liu <sdl.web@gmail.com>
11684
11685 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
11686
5790543d
PE
116872012-04-22 Paul Eggert <eggert@cs.ucla.edu>
11688
11689 * sysdep.c [__FreeBSD__]: Minor cleanups.
11690 (list_system_processes, system_process_attributes) [__FreeBSD__]:
11691 Use Emacs indenting style more consistently. Avoid some casts.
11692 Use 'double' consistently rather than mixing 'float' and 'double'.
11693
b91b7e4d
EW
116942012-04-21 Eduard Wiebe <usenet@pusto.de>
11695
b593d6a9
AH
11696 * sysdep.c (list_system_processes, system_process_attributes):
11697 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 11698
6114eb15
AS
116992012-04-21 Andreas Schwab <schwab@linux-m68k.org>
11700
11701 * lisp.mk (lisp): Update.
11702
2f38dff7
PE
117032012-04-20 Paul Eggert <eggert@cs.ucla.edu>
11704
11705 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
11706 It is never used otherwise.
11707
4ae29f89
SM
117082012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
11709
11710 * print.c (print_preprocess): Only check print_depth if print-circle
11711 is nil.
11712 (print_object): Check for cycles even when print-circle is nil and
11713 print-gensym is t, but only check print_depth if print-circle is nil.
11714
f30d612a
CY
117152012-04-20 Chong Yidong <cyd@gnu.org>
11716
11717 * process.c (wait_reading_process_output): If EIO occurs on a pty,
11718 set the status to "failed" and ensure that sentinel is run.
11719
c07a4c0b 117202012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
11721
11722 * process.c (Fset_process_inherit_coding_system_flag)
11723 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 11724 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 11725
c07a4c0b 117262012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
11727
11728 * xdisp.c (string_buffer_position_lim): Limit starting position to
11729 BEGV.
11730 (set_cursor_from_row): If called for a mode-line or header-line
11731 row, return zero immediately.
11732 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
11733 farther than the first row after the header line, if any.
11734 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
11735 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
11736
c07a4c0b 117372012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 11738
4ae29f89
SM
11739 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
11740 (bug#11238).
ad3a2b41 11741
c07a4c0b 117422012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 117432012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
11744
11745 configure: new option --enable-gcc-warnings (Bug#11207)
11746 * Makefile.in (C_WARNINGS_SWITCH): Remove.
11747 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
11748 (ALL_CFLAGS): Use new macros rather than old.
11749 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
11750 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
11751 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
11752 -Wunused-result, -Wunused-variable. This should go away once
11753 the Emacs and Gnulib regex code is merged.
11754 (xmalloc, xrealloc): Now static.
11755
aba027e8
PE
117562012-04-17 Paul Eggert <eggert@cs.ucla.edu>
11757
11758 * dired.c (Fsystem_groups): Remove unused local.
11759
e5a36063
GM
117602012-04-17 Glenn Morris <rgm@gnu.org>
11761
11762 * dired.c (Fsystem_users): Doc fix.
11763
316411f0
DA
117642012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
11765
11766 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
11767 (syms_of_dired): Add them.
11768
9426aba4
PE
117692012-04-16 Paul Eggert <eggert@cs.ucla.edu>
11770
b62a57be
PE
11771 Fix minor alloc.c problems found by static checking.
11772 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
11773 New extern decls, to avoid calling undeclared functions.
11774 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
11775 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
11776 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
11777 (NEED_MEM_INSERT): New macro.
11778 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 11779 Remove one incorrect comment and fix another.
b62a57be 11780
3539f31f
PE
11781 Fix minor ralloc.c problems found by static checking.
11782 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
11783 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
11784 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
11785 (r_alloc_sbrk): Now static.
11786
a041960a
PE
11787 Improve ralloc.c interface checking.
11788 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
11789 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
11790 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
11791 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
11792 [REL_ALLOC]: ... to here, to check interface.
11793 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
11794 Remove decls. This fixes an "It stinks!".
11795
9426aba4
PE
11796 * alloc.c (which_symbols): Fix alignment issue / type clash.
11797
d55c12ed
AS
117982012-04-15 Andreas Schwab <schwab@linux-m68k.org>
11799
11800 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
11801 (struct Lisp_Misc_Any): Likewise.
11802 (struct Lisp_Free): Likewise.
11803 * alloc.c (union aligned_Lisp_Symbol): Define.
11804 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
11805 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
11806 (union aligned_Lisp_Misc): Define.
11807 (MARKER_BLOCK_SIZE, struct marker_block): Use union
11808 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 11809 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 11810
b948ce8b
PE
118112012-04-14 Paul Eggert <eggert@cs.ucla.edu>
11812
11813 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
11814 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
11815 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
11816 * s/netbsd.h, s/sol2-6.h:
11817 Remove definition of GC_MARK_STACK, since the default now works.
11818 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
11819 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
11820 no longer the default.
11821 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
11822
35dc09a1 118232012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 11824
35dc09a1
GM
11825 * lread.c (lisp_file_lexically_bound_p):
11826 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 11827
35dc09a1
GM
118282012-04-14 Eli Zaretskii <eliz@gnu.org>
11829
11830 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
11831 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
11832
118332012-04-14 Jan Djärv <jan.h.d@swipnet.se>
11834
11835 * nsterm.m (constrainFrameRect): Always constrain when there is only
11836 one screen (Bug#10962).
11837
bcd86815
KB
118382012-04-13 Ken Brown <kbrown@cornell.edu>
11839
11840 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
11841
c25df26e
RT
118422012-04-13 Reuben Thomas <rrt@sc3d.org>
11843
11844 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
11845
0fc59f1e
DC
118462012-04-11 Daniel Colascione <dancol@dancol.org>
11847
11848 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
11849 against is gone. It's better to use vfork now so that when Cygwin
11850 gains a new, working vfork, we use it automatically (bug#10398).
11851
de8c03dc
SM
118522012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
11853
11854 * window.c (save_window_save): Obey window-point-insertion-type.
11855
2f097256
GM
118562012-04-11 Glenn Morris <rgm@gnu.org>
11857
11858 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
11859
453b951e
SM
118602012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
11861
11862 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
11863
75f1671a 118642012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
11865
11866 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
11867 (force_quit_count): New var.
11868 (handle_interrupt): Use it.
11869
2a8ce227
JB
118702012-04-10 Juanma Barranquero <lekktu@gmail.com>
11871
11872 * w32.c (w32_delayed_load): Record the full path of the library
11873 being loaded (bug#10424).
11874
935396c0
GM
118752012-04-09 Glenn Morris <rgm@gnu.org>
11876
05920a43
GM
11877 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
11878 not just in the obarray, before snarfing them. (Bug#11036)
11879
935396c0
GM
11880 * Makefile.in ($(leimdir)/leim-list.el):
11881 Pass EMACS rather than BUILT_EMACS.
11882
a18ecafa
TZ
118832012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
11884
11885 * process.c (make_process):
11886 * process.h: Add integer `gnutls_handshakes_tried' member to
11887 process struct.
11888
6bbef4e5
JC
11889 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
11890 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
11891
11892 * gnutls.c (gnutls_log_function2i): Convenience log function.
11893 (emacs_gnutls_read): Use new log functions,
11894 `gnutls_handshakes_tried' process member, and
11895 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
11896 attempts per process (connection).
11897
b4d3bc10
CY
118982012-04-09 Chong Yidong <cyd@gnu.org>
11899
11900 * eval.c (Fuser_variable_p, user_variable_p_eh)
11901 (lisp_indirect_variable): Functions deleted.
11902 (Fdefvar): Caller changed.
11903
11904 * callint.c (Finteractive, Fcall_interactively):
11905 * minibuf.c (Fread_variable): Callers changed.
11906
70f4d973
EZ
119072012-04-09 Eli Zaretskii <eliz@gnu.org>
11908
11909 * xdisp.c (set_cursor_from_row): If the display string appears in
11910 the buffer at position that is closer to point than the position
11911 after the display string, display the cursor on the first glyph of
11912 the display string. Fixes cursor display when a 'display' text
11913 property immediately follows invisible text. (Bug#11094)
11914
cb3c2e3e
PE
119152012-04-09 Paul Eggert <eggert@cs.ucla.edu>
11916
11917 composite.c: use 'double' consistently
11918 * composite.c (get_composition_id): Use 'double' consistently
11919 instead of converting 'float' to 'double' and vice versa; this is
11920 easier to understand and avoids a GCC warning.
11921
fd06db5d
GM
119222012-04-09 Glenn Morris <rgm@gnu.org>
11923
50fe702a
GM
11924 * Makefile.in: Generate leim-list with bootstrap-emacs, in
11925 preparation for dumping it with emacs. (Bug#4789)
11926 (leimdir): New variable.
11927 ($(leimdir)/leim-list.el): New rule.
11928 (emacs$(EXEEXT)): Depend on leim-list.el.
11929
fd06db5d
GM
11930 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
11931 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
11932 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
11933
55c131ee
AS
119342012-04-08 Andreas Schwab <schwab@linux-m68k.org>
11935
11936 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
11937 proper alignment.
11938
9209588f
JB
119392012-04-07 Juanma Barranquero <lekktu@gmail.com>
11940
11941 * xml.c (init_libxml2_functions) [WINDOWSNT]:
11942 Remove unused local variable.
11943
e3fb2efb
PE
119442012-04-07 Paul Eggert <eggert@cs.ucla.edu>
11945
11946 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
11947 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
11948 (mark_memory): Mark Lisp_Objects only if pointers might hide in
11949 objects, as mark_maybe_pointer will catch them otherwise.
11950 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
11951 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
11952
b5385551
PE
119532012-04-07 Paul Eggert <eggert@cs.ucla.edu>
11954
11955 Fix typo that broke non-Windows builds.
11956 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
11957
9078ead6
EZ
119582012-04-07 Eli Zaretskii <eliz@gnu.org>
11959
11960 Support building on MS-Windows with libxml2.
11961
11962 * makefile.w32-in (OBJ2): Add xml.$(O).
11963 (GLOBAL_SOURCES): Add xml.c.
11964 ($(BLD)/xml.$(O)): New dependency list.
11965
11966 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
11967 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
11968 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
11969 [!WINDOWSNT]: New macros.
11970 (init_libxml2_functions, libxml2_loaded_p): New functions.
11971 (parse_region): Call fn_xmlCheckVersion instead of using the macro
11972 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
11973 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
11974 Calls xmlCleanupParser only if libxml2 was loaded (or statically
11975 linked in).
6bbef4e5
JC
11976 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
11977 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
11978 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
11979
11980 * emacs.c: Don't include libxml/parser.h.
11981 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
11982 xmlCleanupParser directly.
11983
11984 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
11985
3811fdf3
EZ
119862012-04-07 Eli Zaretskii <eliz@gnu.org>
11987
11988 * indent.c (Fvertical_motion): If there is a display string at
11989 point, use it.vpos to compute how many lines to backtrack after
11990 move_it_to point. (Bug#11133)
11991
2f8e16b2
EZ
119922012-04-06 Eli Zaretskii <eliz@gnu.org>
11993
11994 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
11995 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
11996 about subtle differences between FETCH_CHAR* and STRING_CHAR*
11997 macros related to unification of CJK characters. For the details,
11998 see the discussion following the message here:
11999 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
12000
3d439cd1
CY
120012012-04-04 Chong Yidong <cyd@gnu.org>
12002
12003 * keyboard.c (Vdelayed_warnings_list): Doc fix.
12004
8bc53d00
EZ
120052012-04-01 Eli Zaretskii <eliz@gnu.org>
12006
12007 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
12008 instead of alloca. (Bug#11138)
12009
3b0512a3
AS
120102012-04-01 Andreas Schwab <schwab@linux-m68k.org>
12011
12012 * w32menu.c (is_simple_dialog): Properly check lisp types.
12013 (Bug#11141)
12014
8427ddd2
EZ
120152012-03-31 Eli Zaretskii <eliz@gnu.org>
12016
979022ef
EZ
12017 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
12018 position we get to after a call to move_it_to fails the
12019 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
12020 only if we wind up in a string from display property. (Bug#11063)
12021
a6b1c7cc
EZ
12022 * window.c (Fdelete_other_windows_internal): Invalidate the row
12023 and column information about mouse highlight, so that redisplay
12024 restores it after reallocating the glyph matrices. (Bug#7464)
12025
8427ddd2
EZ
12026 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
12027 string comes from a `display' text property, use the buffer
12028 position of that property as if we actually saw that position in
12029 the row's glyphs.
697ba24b
EZ
12030 (move_it_by_lines): Remove the assertion that
12031 "it->current_x == 0 && it->hpos == 0" which can be legitimately
12032 violated when there's a before-string at the beginning of a line.
12033 (Bug#11063)
8427ddd2 12034
65a0a738
EZ
120352012-03-30 Eli Zaretskii <eliz@gnu.org>
12036
12037 * xdisp.c (append_space_for_newline): If the default face was
12038 remapped, use the remapped face for the appended newline.
12039 (extend_face_to_end_of_line): Use the remapped default face for
12040 extending the face to the end of the line.
12041 (display_line): Call extend_face_to_end_of_line when the default
12042 face was remapped. (Bug#11068)
12043
581355cc
EZ
120442012-03-29 Eli Zaretskii <eliz@gnu.org>
12045
12046 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
12047
e8fc049f
SM
120482012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
12049
12050 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
12051
4fb9a543
GM
120522012-03-27 Glenn Morris <rgm@gnu.org>
12053
12054 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
12055 Doc fixes.
12056
679910f1
KH
120572012-03-26 Kenichi Handa <handa@m17n.org>
12058
12059 * dispextern.h (struct glyph): Fix previous change. Change the
12060 bit length of glyphless.ch to 25 (Bug#11082).
12061
90d49b7f
CY
120622012-03-26 Chong Yidong <cyd@gnu.org>
12063
12064 * keyboard.c (Vselection_inhibit_update_commands): New variable.
12065 (command_loop_1): Use it; inhibit selection update for
12066 handle-select-window too (Bug#8996).
12067
f514f6f0
FP
120682012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
12069
e8fc049f 12070 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 12071
bf43fa51
KH
120722012-03-25 Kenichi Handa <handa@m17n.org>
12073
12074 * dispextern.h (struct glyph): Change the bit length of
12075 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
12076
8a0c01dd
EZ
120772012-03-24 Eli Zaretskii <eliz@gnu.org>
12078
12079 * s/ms-w32.h (tzname): Include time.h before redirecting to
12080 _tzname. Fixes the MSVC build. (Bug#9960)
12081
7d1c3a76
AS
120822012-03-24 Andreas Schwab <schwab@linux-m68k.org>
12083
8ed79523
AS
12084 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
12085 characters.
12086
7d1c3a76
AS
12087 * xterm.c (XTread_socket): Only modify handling_signal if
12088 !SYNC_INPUT. (Bug#11080)
12089
e99a9b8b
EZ
120902012-03-23 Eli Zaretskii <eliz@gnu.org>
12091
12092 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
12093 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
12094 when fetching a multibyte character consumes more bytes than
12095 CHAR_BYTES returns, due to unification of CJK characters in
12096 string_char. (Bug#11073)
12097
5063c0e1
TN
120982012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
12099
12100 * process.c (wait_reading_process_output): Handle pty disconnect
12101 by refraining from sending oneself a SIGCHLD (bug#10933).
12102
9f851fbd
CY
121032012-03-22 Chong Yidong <cyd@gnu.org>
12104
12105 * dispextern.h (struct it): New member string_from_prefix_prop_p.
12106
5063c0e1 12107 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
12108 Mark string as coming from a prefix property.
12109 (handle_face_prop): Use default face for prefix strings (Bug#4281).
12110 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
12111
fb5b8aca
CY
121122012-03-21 Chong Yidong <cyd@gnu.org>
12113
12114 * xfaces.c (Vface_remapping_alist): Doc fix.
12115
62356a1b
EZ
121162012-03-20 Eli Zaretskii <eliz@gnu.org>
12117
12118 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
12119 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
12120 Doc fixes.
62356a1b 12121
025de85b
CY
121222012-03-20 Chong Yidong <cyd@gnu.org>
12123
12124 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
12125 to reflect default non-nil value of redisplay-dont-pause.
12126
4827f94e
KH
121272012-03-19 Kenichi Handa <handa@m17n.org>
12128
12129 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
12130 it fit in a valid range (Bug#11003).
12131
e50a24a2
EZ
121322012-03-18 Eli Zaretskii <eliz@gnu.org>
12133
12134 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
12135 that is not from display property, accept the row as a "cursor
12136 row" if one of the string's character has a non-nil `cursor'
12137 property. Fixes cursor positioning when there are newlines in
12138 overlay strings, e.g. in icomplete.el. (Bug#11035)
12139
9af5ed87
PE
121402012-03-12 Paul Eggert <eggert@cs.ucla.edu>
12141
12142 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
12143
d1f55f16
CY
121442012-03-12 Chong Yidong <cyd@gnu.org>
12145
12146 * eval.c (inhibit_lisp_code): Rename from
12147 inhibit_window_configuration_change_hook; move from window.c.
12148
12149 * xfns.c (unwind_create_frame_1, Fx_create_frame):
12150 * window.c (run_window_configuration_change_hook)
12151 (syms_of_window): Callers changed.
12152
66c5eebd
CY
121532012-03-11 Chong Yidong <cyd@gnu.org>
12154
413df973
CY
12155 * keymap.c (Fkey_description): Doc fix (Bug#9700).
12156
66c5eebd
CY
12157 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
12158
1de11f56
CY
121592012-03-10 Chong Yidong <cyd@gnu.org>
12160
12161 * frame.c (other_visible_frames): Don't assume the selected frame
12162 is visible (Bug#10955).
12163
cae07000
SM
121642012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
12165
12166 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
12167
89c94350
JD
121682012-03-08 Jan Djärv <jan.h.d@swipnet.se>
12169
12170 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
12171 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
12172 zero (Bug#10954).
12173
999dd333
GM
121742012-03-03 Glenn Morris <rgm@gnu.org>
12175
01a6dcc8 12176 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 12177
de0100f2
EZ
121782012-03-02 Eli Zaretskii <eliz@gnu.org>
12179
12180 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
12181 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
12182 (redisplay_window, next_element_from_string): Fix typos in
12183 comments.
3e441275
EZ
12184 (redisplay_window): Pass to move_it_vertically the margin in
12185 pixels, not in screen lines.
de0100f2 12186
96a72ee9
GM
121872012-03-02 Glenn Morris <rgm@gnu.org>
12188
12189 * buffer.c (buffer-list-update-hook): Doc fix.
12190
312508d7
EZ
121912012-02-29 Eli Zaretskii <eliz@gnu.org>
12192
12193 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
12194 push_it before setting up the iterator for the first overlay
12195 string, even if we have an empty string loaded.
12196 (next_overlay_string): If there's an empty string on the iterator
12197 stack, pop the stack. (Bug#10903)
12198
27f3c637
PE
121992012-02-25 Paul Eggert <eggert@cs.ucla.edu>
12200
12201 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
12202 Suggested by Stefan Monnier in
12203 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
12204 * alloc.c (widen_to_Lisp_Object): New static function.
12205 (mark_memory): Also mark Lisp_Objects by fetching pointer words
12206 and widening them to Lisp_Objects. This would work even if
12207 USE_LSB_TAG is defined and wide integers are used, which might
12208 happen in a future version of Emacs.
12209
3c9dfce6
CY
122102012-02-25 Chong Yidong <cyd@gnu.org>
12211
fa74b241
CY
12212 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
12213 Doc fix.
12214
3c9dfce6
CY
12215 * xselect.c (Fx_selection_exists_p): Doc fix.
12216 (x_clipboard_manager_save_all): Print an informative message
12217 before saving to clipboard manager.
12218
9486df08
CY
122192012-02-24 Chong Yidong <cyd@gnu.org>
12220
12221 * keyboard.c (process_special_events): Handle all X selection
12222 requests in kbd_buffer, not just the next one (Bug#8869).
12223
f01d3321
CY
122242012-02-23 Chong Yidong <cyd@gnu.org>
12225
12226 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
12227 call when setting menu-bar-lines and tool-bar-lines parameters.
12228 (unwind_create_frame_1): New helper function.
12229
12230 * window.c (inhibit_window_configuration_change_hook): New var.
12231 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 12232 (syms_of_window): Initialize it.
f01d3321 12233
86b847b6
CY
122342012-02-22 Chong Yidong <cyd@gnu.org>
12235
12236 * xterm.c (x_draw_image_relief): Add missing type check for
12237 Vtool_bar_button_margin (Bug#10743).
12238
a59225b1
CY
122392012-02-21 Chong Yidong <cyd@gnu.org>
12240
12241 * fileio.c (Vfile_name_handler_alist): Doc fix.
12242
12243 * buffer.c (Fget_file_buffer): Protect against invalid file
12244 handler return value.
12245
310f5bd4
PE
122462012-02-20 Paul Eggert <eggert@cs.ucla.edu>
12247
cb3a28cc
PE
12248 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
12249 when computing $valmask.
12250
310f5bd4
PE
12251 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
12252 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
12253 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
12254 It's useless in that case, and it can cause problems on hosts
12255 that allocate halves of EMACS_INT values separately.
12256 Reported by Dan Horák. Diagnosed by Andreas Schwab in
12257 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
12258 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
12259 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
12260 it avoids undefined behavior on hosts where shifting right by more
12261 than the word width has undefined behavior.
12262
2375c96a
CY
122632012-02-19 Chong Yidong <cyd@gnu.org>
12264
12265 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
12266 (Funhandled_file_name_directory, Ffile_name_as_directory)
12267 (Fdirectory_file_name, Fexpand_file_name)
12268 (Fsubstitute_in_file_name): Protect against invalid file handler
12269 return values (Bug#10845).
12270
3eb49e71
EZ
122712012-02-18 Eli Zaretskii <eliz@gnu.org>
12272
12273 * .gdbinit (pitx): Fix incorrect references to fields of the
12274 iterator stack.
12275
7b926f3f
CY
122762012-02-17 Chong Yidong <cyd@gnu.org>
12277
12278 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
12279
11273115
PE
122802012-02-15 Paul Eggert <eggert@cs.ucla.edu>
12281
12282 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
12283 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
12284
c3a70e2b
CY
122852012-02-15 Chong Yidong <cyd@gnu.org>
12286
12287 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
12288 marked as special. Also, starting docstrings with * is obsolete.
12289
0ca43699
AS
122902012-02-13 Andreas Schwab <schwab@linux-m68k.org>
12291
12292 * gnutls.c (emacs_gnutls_write): Fix last change.
12293
2e8f3c56
LI
122942012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
12295
12296 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
12297 send_process.
12298
af70074f
SM
122992012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
12300
12301 * keymap.c (Fsingle_key_description): Handle char ranges.
12302
95986d52
CY
123032012-02-12 Chong Yidong <cyd@gnu.org>
12304
afd83bd1
CY
12305 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
12306 as that creates a dangerous corner case.
12307
95986d52
CY
12308 * window.c (Fdelete_window_internal): Invalidate the mouse
12309 highlight (Bug#9904).
12310
bd7da63e
GM
123112012-02-12 Glenn Morris <rgm@gnu.org>
12312
12313 * xselect.c (Fx_own_selection_internal)
12314 (Fx_get_selection_internal, Fx_disown_selection_internal)
12315 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
12316 * nsselect.m (Fx_own_selection_internal)
12317 (Fx_disown_selection_internal, Fx_selection_exists_p)
12318 (Fx_selection_owner_p, Fx_get_selection_internal):
12319 Sync docs and argument specs with the xselect.c versions.
12320
77abcbc2
LI
123212012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
12322
12323 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
12324
90b671e2
EZ
123252012-02-11 Eli Zaretskii <eliz@gnu.org>
12326
1c0ca0b7
EZ
12327 * w32select.c (Fx_selection_exists_p): Sync doc string and
12328 argument list with xselect.c. (Bug#10783)
12329
12330 * w16select.c (Fx_selection_exists_p): Sync doc string and
12331 argument list with xselect.c. (Bug#10783)
90b671e2 12332
49241268
GM
123332012-02-10 Glenn Morris <rgm@gnu.org>
12334
12335 * fns.c (Fsecure_hash): Doc fix.
12336
f998bbe7 123372012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
12338
12339 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
12340
0992bd9c
CY
123412012-02-07 Chong Yidong <cyd@gnu.org>
12342
12343 * buffer.c (Fbuffer_local_variables)
12344 (buffer_lisp_local_variables): Handle unbound vars correctly;
12345 don't let Qunbound leak into Lisp.
12346
af008560
GM
123472012-02-07 Glenn Morris <rgm@gnu.org>
12348
dd605cc4
GM
12349 * image.c (Fimagemagick_types): Doc fix.
12350
af008560
GM
12351 * image.c (imagemagick-render-type): Change it from a lisp object
12352 to an integer. Move the doc here from the lisp manual.
12353 Treat all values not equal to 0 the same.
12354
1449fa1d
CY
123552012-02-06 Chong Yidong <cyd@gnu.org>
12356
12357 * doc.c (store_function_docstring): Avoid applying docstring of
12358 alias to base function (Bug#2603).
12359
3723ec07
AS
123602012-02-04 Andreas Schwab <schwab@linux-m68k.org>
12361
12362 * .gdbinit (pp1, pv1): Remove redundant defines.
12363 (pr): Use pp.
12364
79c1cc1e
CY
123652012-02-04 Chong Yidong <cyd@gnu.org>
12366
12367 * nsterm.m: Declare a global (Bug#10694).
12368
d7f29f8e
EZ
123692012-02-04 Eli Zaretskii <eliz@gnu.org>
12370
cae07000
SM
12371 * w32.c (get_emacs_configuration_options):
12372 Include --enable-checking, if specified, in the return value.
d7f29f8e 12373
3b95a6f9
MR
123742012-02-04 Martin Rudalics <rudalics@gmx.at>
12375
12376 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
12377 after rounding frame sizes. (Bug#9723)
12378
d6fa96a6
EZ
123792012-02-04 Eli Zaretskii <eliz@gnu.org>
12380
12381 * keyboard.c (adjust_point_for_property): Don't position point
12382 before BEGV. (Bug#10696)
12383
df0b2940
PE
123842012-02-03 Paul Eggert <eggert@cs.ucla.edu>
12385
12386 Handle overflow when computing char display width (Bug#9496).
12387 * character.c (char_width): Return EMACS_INT, not int.
12388 (char_width, c_string_width): Check for overflow when
12389 computing the width; this is possible now that individual
12390 characters can have unbounded width. Problem introduced
12391 by merge from Emacs 23 on 2012-01-19.
12392
6bee44d6
MA
123932012-02-02 Michael Albinus <michael.albinus@gmx.de>
12394
12395 * dbusbind.c (Fdbus_register_method): Mention the return value
12396 :ignore in the docstring.
12397
44f92739
GM
123982012-02-02 Glenn Morris <rgm@gnu.org>
12399
1b9f60cc
GM
12400 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
12401
44f92739
GM
12402 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
12403 Unconditionally set to t. (Bug#10673)
12404 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
12405 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
12406 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
12407
c5d3843c
KH
124082012-02-02 Kenichi Handa <handa@m17n.org>
12409
12410 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
12411 0, do not call append_composite_glyph.
12412
159462d4 124132012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
12414
12415 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
12416 NULL (Bug#6988).
12417 (x_produce_glyphs): If the component of a composition is a null
12418 string, set it->pixel_width to 1 to avoid zero-width glyph.
12419
78cef877
EZ
124202012-02-01 Eli Zaretskii <eliz@gnu.org>
12421
12422 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
12423 first 2 arguments are identical. This makes inserting large
12424 output from a subprocess an order of magnitude faster on
12425 MS-Windows, where all sbrk'ed memory is always contiguous.
12426
97897668
GM
124272012-01-31 Glenn Morris <rgm@gnu.org>
12428
12429 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 12430 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
12431 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
12432
31fd3586
GM
124332012-01-29 Glenn Morris <rgm@gnu.org>
12434
12435 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
12436
0e24a8b2
CY
124372012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
12438
12439 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
12440
cc0adcb0
CY
124412012-01-28 Chong Yidong <cyd@gnu.org>
12442
12443 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
12444
acc28cb9
CY
124452012-01-26 Chong Yidong <cyd@gnu.org>
12446
9c69cfb7
CY
12447 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
12448
acc28cb9
CY
12449 * search.c (Fsearch_forward, Fsearch_backward): Document negative
12450 repeat counts (Bug#10507).
12451
48da7392
GM
124522012-01-26 Glenn Morris <rgm@gnu.org>
12453
12454 * lread.c (syms_of_lread): Doc fix.
12455
14af5f7f
CY
124562012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
12457
12458 * coding.c (encode_designation_at_bol): Change return value to
12459 EMACS_INT.
12460
0b21c100
CY
124612012-01-25 Chong Yidong <cyd@gnu.org>
12462
12463 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
12464
3c2907f7
CY
124652012-01-21 Chong Yidong <cyd@gnu.org>
12466
12467 * floatfns.c (Fcopysign): Make the second argument non-optional,
12468 since nil is not allowed anyway.
12469
959ad23f
AS
124702012-01-21 Andreas Schwab <schwab@linux-m68k.org>
12471
12472 * process.c (read_process_output): Use p instead of XPROCESS (proc).
12473 (send_process): Likewise.
12474
34a02f46
MR
124752012-01-19 Martin Rudalics <rudalics@gmx.at>
12476
12477 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
12478 (Vwindow_persistent_parameters): Do not use Qstate.
12479 Rewrite doc-strings.
34a02f46 12480
1259009a 124812012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
12482
12483 * character.c (char_width): New function.
70d4fdf6
GM
12484 (Fchar_width, c_string_width, lisp_string_width):
12485 Use char_width (Bug#9496).
25ed9e61 12486
6a6ee00d
MR
124872012-01-16 Martin Rudalics <rudalics@gmx.at>
12488
12489 * window.c (Vwindow_persistent_parameters): New variable.
12490 (Fset_window_configuration, save_window_save): Handle persistent
12491 window parameters.
12492
c85efaf7
EZ
124932012-01-14 Eli Zaretskii <eliz@gnu.org>
12494
12495 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
12496 thrashing the stack of the thread. (Bug#9087)
12497
5944709e
PE
124982012-01-12 Paul Eggert <eggert@cs.ucla.edu>
12499
12500 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
12501
e71f5d99
EZ
125022012-01-11 Eli Zaretskii <eliz@gnu.org>
12503
12504 * xdisp.c (rows_from_pos_range): Handle the case where the
12505 highlight ends on a newline. (Bug#10464)
12506 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
12507 he end column for display of highlight that ends on a newline
12508 before a R2L line.
12509
ce316182
GM
125102012-01-11 Glenn Morris <rgm@gnu.org>
12511
12512 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
12513 from load-path also when installation-directory is nil. (Bug#10208)
12514
5b43da69
GM
125152012-01-10 Glenn Morris <rgm@gnu.org>
12516
74cc8ff9
GM
12517 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
12518
7d8d6e4e
GM
12519 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
12520 Update template values to be closer to their typical values these days.
5b43da69 12521
a0db8d43
EZ
125222012-01-09 Eli Zaretskii <eliz@gnu.org>
12523
12524 * xdisp.c (rows_from_pos_range): Accept additional argument
12525 DISP_STRING, and accept any glyph in a row whose object is that
12526 string as eligible for mouse highlight. Fixes mouse highlight of
12527 display strings from overlays. (Bug#10464)
12528
9a0115ab 125292012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 12530
b9110d6a 12531 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
12532 * fileio.c (auto_saving_dir_umask): New static var.
12533 (Fmake_directory_internal): Use it.
12534 (do_auto_save_make_dir): Set it, instead of invoking chmod after
12535 creating the directory. The old code temporarily assigns
12536 too-generous permissions to the directory.
12537 (do_auto_save_eh): Clear it.
b9110d6a 12538 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
12539 that the var is always cleared.
12540
6c1bd3f3
EZ
125412012-01-07 Eli Zaretskii <eliz@gnu.org>
12542
12543 * search.c (scan_buffer): Pass character positions to
12544 know_region_cache, not byte positions. (Bug#6540)
12545
069d2b50
L
125462012-01-07 LynX <_LynX@bk.ru> (tiny change)
12547
12548 * w32.c (sys_rename): Report EXDEV when rename of a directory
12549 fails because the target is on another logical disk. (Bug#10284)
12550
75bf0d33
DB
125512012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
12552
12553 * xterm.c (x_embed_request_focus): New function.
12554
12555 * xterm.h: Add prototype.
12556
12557 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
12558
1c6e5a32
GM
125592012-01-05 Glenn Morris <rgm@gnu.org>
12560
12561 * emacs.c (emacs_copyright): Update short copyright year to 2012.
12562
651e947e
EZ
125632012-01-01 Eli Zaretskii <eliz@gnu.org>
12564
12565 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
12566 Load gnutls_transport_set_lowat only if GnuTLS version is below
12567 2.11.1.
12568 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
12569 GnuTLS versions below 2.11.1.
12570
3778cdd8
AL
125712011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
12572
12573 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
12574 to the doc string advising against its use for altering the way
12575 windows are scrolled.
12576
0e5317f7
KH
125772011-12-28 Kenichi Handa <handa@m17n.org>
12578
12579 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
12580 coding-system ASCII compatible only when it does not produce BOM
12581 on encoding (Bug#10383).
12582
93d5ca1f
JD
125832011-12-26 Jan Djärv <jan.h.d@swipnet.se>
12584
12585 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
12586 can scroll.
12587 (create_and_show_popup_menu): Always use menu_position_func for
12588 Gtk3 (Bug#10361).
12589
ca22b785
AS
125902011-12-24 Andreas Schwab <schwab@linux-m68k.org>
12591
12592 * callint.c (Fcall_interactively): Don't truncate prompt string.
12593
d048e1e6
EZ
125942011-12-23 Eli Zaretskii <eliz@gnu.org>
12595
12596 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
12597 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 12598 resumed from there (after widening). (Bug#10360)
d048e1e6 12599
5ccaba1f
JD
126002011-12-22 Jan Djärv <jan.h.d@swipnet.se>
12601
12602 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
12603
204ee57f
JD
126042011-12-21 Jan Djärv <jan.h.d@swipnet.se>
12605
b81d40f0
JB
12606 * nsterm.m (x_free_frame_resources):
12607 Release f->output_data.ns->miniimage.
204ee57f
JD
12608 (ns_index_color): Fix indentation. Do not retain
12609 color_table->colors[i].
12610
12611 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
12612 before returning.
12613
12614 * nsfns.m (x_set_background_color): Assign return value from
12615 ns_index_color to face-background instead of NSColor*.
12616 (ns_implicitly_set_icon_type): Fix indentation.
12617 Change assignment in for loop to comparison.
12618
12619 * emacs.c (ns_pool): New variable.
12620 (main): Assign ns_pool.
12621 (Fkill_emacs): Call ns_release_autorelease_pool.
12622
12623 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
12624 autorelease fdesc, release fdAttrs and tdict.
12625 (ns_get_covering_families): Release charset.
12626 (ns_findfonts): Release NSFontDescriptor created with new.
12627 (ns_uni_to_glyphs): Fix indentation.
12628 (setString): Release attrStr before assigning new value.
12629
c803b2b7
JD
126302011-12-18 Jan Djärv <jan.h.d@swipnet.se>
12631
678f4426
JD
12632 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
12633 and NS_IMPL_COCOA.
12634 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
12635 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
12636
cd394be1 126372011-12-18 David Reitter <reitter@cmu.edu>
678f4426 12638
5fecd5fc
JD
12639 * nsterm.m (ns_term_init): Subscribe for notifications
12640 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
12641 to method trackingNotification in EmacsMenu.
12642
12643 * nsmenu.m (trackingMenu): New variable.
3771cb17 12644 (trackingNotification): New method (from Aquamacs).
5fecd5fc 12645 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 12646 from Aquamacs (Bug#7030).
678f4426
JD
12647
126482011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 12649
c803b2b7
JD
12650 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
12651 (symbol_to_nsstring): Fix indentation.
12652 (ns_symbol_to_pb): New function.
cae07000
SM
12653 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
12654 (Fns_rotate_cut_buffers_internal): Remove.
12655 (Fns_store_selection_internal): Rename from
c803b2b7
JD
12656 Fns_store_cut_buffer_internal.
12657 (ns_get_foreign_selection, Fx_own_selection_internal)
12658 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
12659 (Fns_get_selection_internal, Fns_store_selection_internal):
12660 Use ns_symbol_to_pb and check if return value is nil.
12661 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
12662 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
12663 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
12664 renamed to Sns_store_selection_internal.
12665 (ns_handle_selection_request): Move code to Fx_own_selection_internal
12666 and remove this function.
12667 (ns_handle_selection_clear): Remove, never used.
12668 (Fx_own_selection_internal): Move code from ns_handle_selection_request
12669 here.
12670
e1b01a3a
KB
126712011-12-17 Ken Brown <kbrown@cornell.edu>
12672
12673 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
12674 GID is unknown (Bug#10257).
12675
2adb6e85
PE
126762011-12-17 Paul Eggert <eggert@cs.ucla.edu>
12677
12678 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
12679 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
12680 which caused a build failure on GNU/Linux IA-64. This problem was
12681 introduced by my 2011-10-07 patch.
12682
d1d7b339
JL
126832011-12-15 Juri Linkov <juri@jurta.org>
12684
12685 * image.c (imagemagick_error): New function. (Bug#10112)
12686 (imagemagick_load_image): Comment out `MagickSetResolution' call.
12687 Use `imagemagick_error' where ImageMagick functions return
12688 `MagickFalse'.
12689 (Fimagemagick_types): Add `Fnreverse' to return the list in the
12690 proper order.
12691
100d5755
KH
126922011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12693
12694 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
12695 fill background (Bug#8992).
12696
454592a6
MR
126972011-12-13 Martin Rudalics <rudalics@gmx.at>
12698
12699 * window.c (Vwindow_combination_resize)
12700 (Vwindow_combination_limit): Use t instead of non-nil in
12701 doc-strings.
61d4b438
MR
12702 (Vrecenter_redisplay): Add first sentence of doc-string on
12703 separate line.
53524d93 12704 (Frecenter): Fix doc-string typo.
454592a6 12705
3633e3aa
KH
127062011-12-11 Kenichi Handa <handa@m17n.org>
12707
12708 * coding.c (Funencodable_char_position): Pay attention to the
12709 buffer text relocation (Bug#9389).
12710
7b9d523a 127112011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 12712
7b9d523a
JD
12713 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
12714 gtk_init (Bug#10100).
12715
b73189c6
EZ
127162011-12-10 Eli Zaretskii <eliz@gnu.org>
12717
12718 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
12719 IT->string is nil. (Bug#10263)
12720
f7dfe5d6
JD
127212011-12-10 Jan Djärv <jan.h.d@swipnet.se>
12722
83faebb4
JD
12723 * nsterm.h (x_free_frame_resources): Declare.
12724
f7dfe5d6
JD
12725 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
12726 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
12727
12728 * nsterm.h (ns_get_defaults_value): Declare.
12729
12730 * nsterm.m (ns_default): Call ns_get_defaults_value.
12731
7cd4e72c
EZ
127322011-12-09 Eli Zaretskii <eliz@gnu.org>
12733
12734 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
12735 (Bug#10170)
12736
b34d7317
YM
127372011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12738
12739 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
12740 that where the value of an _OBJC_* symbol points to is in the .bss
12741 section (Bug#10240).
12742
76470ad1
KH
127432011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12744
12745 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 12746 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 12747
745fff94
KH
127482011-12-08 Kenichi Handa <handa@m17n.org>
12749
12750 * ftfont.c (get_adstyle_property): Fix previous change
12751 (Bug#10233).
12752
6e44397c
JB
127532011-12-07 Juanma Barranquero <lekktu@gmail.com>
12754
12755 * w32.c (init_environment): If no_site_lisp, remove site-lisp
12756 dirs from the default value of EMACSLOADPATH (bug#10208).
12757
7efa6272
GM
127582011-12-07 Glenn Morris <rgm@gnu.org>
12759
12760 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
12761 installation and source directories as well. (Bug#10208)
12762
f6fc4d87
CY
127632011-12-06 Chong Yidong <cyd@gnu.org>
12764
12765 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
12766
2bf26180
GM
127672011-12-06 Glenn Morris <rgm@gnu.org>
12768
12769 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
12770 as an error, not just -1. (Bug#10217)
12771
3a6ad4f0
CY
127722011-12-05 Chong Yidong <cyd@gnu.org>
12773
12774 * keyboard.c (process_special_events): New function.
12775 (swallow_events, Finput_pending_p): Use it (Bug#10195).
12776
75a3b399
PE
127772011-12-05 Paul Eggert <eggert@cs.ucla.edu>
12778
12779 * coding.c (encode_designation_at_bol): Don't use uninitialized
12780 local variable (Bug#9318).
12781
c3c9e25e
KH
127822011-12-05 Kenichi Handa <handa@m17n.org>
12783
12784 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
12785 return Qnil (Bug#8046, Bug#10193).
12786
5eb05ea3
KH
127872011-12-05 Kenichi Handa <handa@m17n.org>
12788
12789 * coding.c (encode_designation_at_bol): New args charbuf_end and
12790 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
12791 (coding_set_source): Return how many bytes coding->source was
12792 relocated.
12793 (coding_set_destination): Return how many bytes
12794 coding->destination was relocated.
12795 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 12796 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
12797
127982011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12799
12800 * coding.c (CODING_CHAR_CHARSET_P): New macro.
12801 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
12802 macro (Bug#9318).
12803
128042011-12-05 Andreas Schwab <schwab@linux-m68k.org>
12805
12806 The following changes are to fix Bug#9318.
12807
a79703f5 12808 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
12809 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
12810 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 12811 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 12812
7dbda6df
JB
128132011-12-05 Juanma Barranquero <lekktu@gmail.com>
12814
12815 * lisp.h (process_quit_flag): Fix external declaration.
12816
6d5eb5b0
SM
128172011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
12818
12819 Don't macro-inline non-performance-critical code.
12820 * eval.c (process_quit_flag): New function.
12821 * lisp.h (QUIT): Use it.
12822
a0c3fad0
JD
128232011-12-04 Jan Djärv <jan.h.d@swipnet.se>
12824
12825 * nsfns.m (get_geometry_from_preferences): New function.
12826 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
12827
6c07aac2
AS
128282011-12-04 Andreas Schwab <schwab@linux-m68k.org>
12829
12830 * emacs.c (Qkill_emacs): Define.
12831 (syms_of_emacs): Initialize it.
12832 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
12833 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
12834 (quit_throw_to_read_char): Add parameter `from_signal'.
12835 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
12836 * lisp.h (QUIT): Call Fkill_emacs if requested.
12837
c052ead4
JD
128382011-12-03 Jan Djärv <jan.h.d@swipnet.se>
12839
12840 * widget.c (update_wm_hints): Return if wmshell is null.
12841 (widget_update_wm_size_hints): New function.
12842
12843 * widget.h (widget_update_wm_size_hints): Declare.
12844
12845 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
12846 widget_update_wm_size_hints (Bug#10104).
12847
9e49252b
EZ
128482011-12-03 Eli Zaretskii <eliz@gnu.org>
12849
12850 * xdisp.c (handle_invisible_prop): If the invisible text ends just
12851 before a newline, prepare the bidi iterator for consuming the
12852 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 12853 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 12854
02b16839
JL
128552011-12-02 Juri Linkov <juri@jurta.org>
12856
12857 * search.c (Fword_search_regexp): New Lisp function created from
12858 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
12859 (Fword_search_backward, Fword_search_forward)
12860 (Fword_search_backward_lax, Fword_search_forward_lax):
12861 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
12862 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
12863
0068070e
SM
128642011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
12865
12866 * fileio.c (Finsert_file_contents): Move after-change-function call
12867 to before the "handled:" label, since all "goto handled" appear in
12868 cases where the *-change-functions have already been properly called
12869 (bug#10117).
12870
3360a3fc
AS
128712011-12-01 Andreas Schwab <schwab@linux-m68k.org>
12872
12873 * keyboard.c (interrupt_signal): Don't call kill-emacs when
12874 waiting for input. (Bug#10169)
12875
73d6c093
EZ
128762011-11-30 Eli Zaretskii <eliz@gnu.org>
12877
12878 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
12879 verifies glyph row's hash code--we have just reallocated the
12880 glyphs, so their contents can be complete garbage. (Bug#10164)
12881
febe6bea
JB
128822011-11-30 Juanma Barranquero <lekktu@gmail.com>
12883
12884 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
12885
801a4313
EZ
128862011-11-30 Eli Zaretskii <eliz@gnu.org>
12887
12888 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
12889 attributes are tested _before_ calling verify_row_hash, to protect
12890 against GCC re-ordering of the tests. (Bug#10164)
12891
2b56b87e
JD
128922011-11-29 Jan Djärv <jan.h.d@swipnet.se>
12893
12894 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
12895
12896 * xterm.c (handle_one_xevent): Only set async_visible and friends
12897 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 12898 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
12899 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
12900
dbf31225
PE
129012011-11-28 Paul Eggert <eggert@cs.ucla.edu>
12902
12903 Remove GCPRO-related macros that exist only to avoid shadowing locals.
12904 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
12905 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
12906 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
12907 All uses changed to use GCPRO1 etc.
12908 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
12909 Revert to old implementation (i.e., before 2011-03-11).
12910
1305621b
YM
129112011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12912
12913 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
12914 of scroll runs so as to avoid assigning disabled bogus rows and
12915 unnecessary graphics copy operations.
12916
8c9afb46
EZ
129172011-11-27 Eli Zaretskii <eliz@gnu.org>
12918
12919 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
12920 (snprintf) [_MSC_VER]: Redirect to _snprintf.
12921 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
12922 (malloc, free, realloc, calloc): Redirect to e_* only when
12923 compiling Emacs.
12924
12925 * lisp.h (GCTYPEBITS): Move before first use.
12926 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
12927 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
12928 this macro definition.
12929
12930 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
12931 _MSC_VER.
12932
54e9e3bf
JD
129332011-11-27 Jan Djärv <jan.h.d@swipnet.se>
12934
6d5eb5b0
SM
12935 * gtkutil.c (xg_create_frame_widgets):
12936 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
12937 present with Gtk+ 2.0.
12938
83aca1cb
PE
129392011-11-26 Paul Eggert <eggert@cs.ucla.edu>
12940
12941 * fileio.c (Finsert_file_contents): Undo previous change; see
12942 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
12943
5b76caa4
PE
129442011-11-26 Paul Eggert <eggert@cs.ucla.edu>
12945
12946 Rename locals to avoid shadowing.
12947 * fileio.c (Finsert_file_contents):
12948 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
12949 * process.c (wait_reading_process_output):
12950 Rename inner 'proc' to 'p' to avoid shadowing.
12951 Indent for consistency with usual Emacs style.
12952
8c535114
EZ
129532011-11-25 Eli Zaretskii <eliz@gnu.org>
12954
12955 * xdisp.c (redisplay_window): If cursor row is not fully visible
12956 after recentering, and scroll-conservatively is set to a large
12957 number, scroll window by a few more lines to make the cursor fully
12958 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
12959 (start_display): Don't move to the next line if the display should
12960 start at a newline that is part of a display vector or an overlay
12961 string. (Bug#10119)
8c535114 12962
fa4fdb5c
JL
129632011-11-24 Juri Linkov <juri@jurta.org>
12964
12965 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
12966 after the `MagickPingImage' call. (Bug#10112)
12967
90ec88df
CY
129682011-11-23 Chong Yidong <cyd@gnu.org>
12969
12970 * window.c (Fcoordinates_in_window_p): Accept only live windows.
12971
56e2e794
MR
129722011-11-23 Martin Rudalics <rudalics@gmx.at>
12973
12974 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
12975 making another buffer current. (Bug#10114)
12976
b6e64c41
GM
129772011-11-23 Glenn Morris <rgm@gnu.org>
12978
12979 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
12980
6b21de18
CY
129812011-11-23 Chong Yidong <cyd@gnu.org>
12982
12983 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
12984 using it (Bug#5984).
12985
b12cd789
EZ
129862011-11-22 Eli Zaretskii <eliz@gnu.org>
12987
12988 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
12989 and header-lines, as they don't have one computed for them.
12990 (Bug#10098)
12991
12992 * .gdbinit (prow): Make displayed values more self-explaining.
12993 Add row's hash code.
12994
261b6fd4
LMI
129952011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
12996
12997 * process.c (wait_reading_process_output): Fix asynchrounous
12998 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 12999 (wait_reading_process_output): Add comment and URL.
261b6fd4 13000
e7cfd277
JD
130012011-11-21 Jan Djärv <jan.h.d@swipnet.se>
13002
13003 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
13004
a9b9b7f5
CY
130052011-11-21 Chong Yidong <cyd@gnu.org>
13006
13007 * window.c (Fnext_window, Fprevious_window): Doc fix.
13008
b0d15b4f
SM
130092011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
13010
13011 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
13012
fe7a3057
JB
130132011-11-20 Juanma Barranquero <lekktu@gmail.com>
13014
13015 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
13016
d2999b1a
MR
130172011-11-20 Martin Rudalics <rudalics@gmx.at>
13018
13019 * window.c (Fset_window_combination_limit): Rename argument
13020 STATUS to LIMIT.
13021 (Vwindow_combination_limit): Remove "status" from doc-string.
13022
d5ff9cd0
AS
130232011-11-20 Andreas Schwab <schwab@linux-m68k.org>
13024
13025 * m/ibms390.h: Remove.
13026 * m/ibms390x.h: Don't include "ibms390.h".
13027
a5bb9bd3
SM
130282011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
13029
13030 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
13031 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
13032
cd1181db
JB
130332011-11-20 Juanma Barranquero <lekktu@gmail.com>
13034
13035 * casetab.c (Fset_case_table):
13036 * charset.c (Fcharset_after): Fix typos.
13037
615a3b8d 130382011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 13039
17e845af
PE
13040 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
13041 Otherwise, valgrind does not work on some platforms.
13042 Problem reported by Andreas Schwab in
6a0bf43d
PE
13043 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
13044 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
13045 is set, removing the need for VIRT_ADDRESS_VARIES.
13046 (PURE_P): Use a more-efficient implementation that needs just one
13047 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
13048 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
13049 to 4 (xorl, subq, cmpq, setbe).
13050 * alloc.c (pure): Always extern now, since that's the
13051 VIRT_ADDR_VARIES behavior.
13052 (PURE_POINTER_P): Use a single comparison, not two, for
13053 consistency with the new puresize.h.
13054 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
13055 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
13056 Remove VIRT_ADDR_VARIES no longer needed.
13057
f8fe6f96
EZ
130582011-11-19 Eli Zaretskii <eliz@gnu.org>
13059
13060 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
13061 (erase_phys_cursor, update_window_cursor, show_mouse_face)
13062 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
13063 behave as if the cursor position were at the window margin.
13064
13065 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
13066 and the cursor position is out of bounds, behave as if the cursor
13067 position were at the window margin. (Bug#10075)
13068
df05a53c
CY
130692011-11-18 Chong Yidong <cyd@gnu.org>
13070
13071 * window.c (Fwindow_combination_limit): Make first argument
13072 non-optional, since it is meaningless for live windows like the
13073 selected window.
61ccba97 13074
2071918e
DA
130752011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
13076
13077 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
13078
b50a28de
SM
130792011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
13080
13081 * intervals.c: Fix grafting over the whole buffer (bug#10071).
13082 (graft_intervals_into_buffer): Simplify.
13083
015137db
EZ
130842011-11-18 Eli Zaretskii <eliz@gnu.org>
13085
13086 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
13087 hash values of the two rows.
13088 (copy_row_except_pointers): Preserve the used[] arrays and the
13089 hash values of the two rows. (Bug#10035)
68c95424 13090 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
13091
13092 * xdisp.c (row_hash): New function, body extracted from
13093 compute_line_metrics.
13094 (compute_line_metrics): Call row_hash, instead of computing the
13095 hash code inline.
13096
13097 * dispnew.c (verify_row_hash): Call row_hash for computing the
13098 hash code of a row, instead of duplicating code from xdisp.c.
13099
13100 * dispextern.h (row_hash): Add prototype.
13101
a2addb04
TH
131022011-11-18 Tassilo Horn <tassilo@member.fsf.org>
13103
13104 * frame.c (delete_frame): Don't delete the terminal when the last
13105 X frame is closed if emacs is built with GTK toolkit.
13106
df85d315
JB
131072011-11-17 Juanma Barranquero <lekktu@gmail.com>
13108
13109 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
13110
a0c2d0ae
MR
131112011-11-17 Martin Rudalics <rudalics@gmx.at>
13112
13113 * window.c (Vwindow_splits): Rename to
13114 Vwindow_combination_resize. Suggested by Juri Linkov.
13115 (Fsplit_window_internal): Use Vwindow_combination_resize instead
13116 of Vwindow_splits.
13117
58179cce
JB
131182011-11-16 Juanma Barranquero <lekktu@gmail.com>
13119
7877f373
JB
13120 * nsfns.m (Fns_font_name):
13121 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 13122
b6f67890
MR
131232011-11-16 Martin Rudalics <rudalics@gmx.at>
13124
13125 * window.h (window): Rename slot "nest" to "combination_limit".
13126 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
13127 (Fset_window_nest): Rename to Fset_window_combination_limit.
13128 (Vwindow_nest): Rename to Vwindow_combination_limit.
13129 (recombine_windows, make_parent_window, make_window)
13130 (Fsplit_window_internal, saved_window)
13131 (Fset_window_configuration, save_window_save): Rename all
13132 occurrences of window_nest to window_combination_limit.
13133
c7015153
JB
131342011-11-15 Juanma Barranquero <lekktu@gmail.com>
13135
13136 * image.c (imagemagick_load_image): Fix typo.
13137
322ad6ec
EZ
131382011-11-14 Eli Zaretskii <eliz@gnu.org>
13139
13140 * xdisp.c (display_line): Move the call to
13141 highlight_trailing_whitespace before the call to
13142 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
13143 faces of all the glyphs to compute ROW's hash value.
13144 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 13145
f067b8ec
JB
131462011-11-14 Juanma Barranquero <lekktu@gmail.com>
13147
13148 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
13149 just return (bug#10044).
13150
1e5b2111
EZ
131512011-11-12 Eli Zaretskii <eliz@gnu.org>
13152
7ef3cbd5
EZ
13153 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
13154 with user-defined heap size. Bump the default size of the temacs
13155 heap to 27MB, to avoid memory warning when running temacs.
13156 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
13157
1e5b2111
EZ
13158 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
13159 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
13160 (verify_row_hash) [XASSERTS]: New function.
13161 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
13162 that the hash value of glyph rows is correct.
1e5b2111 13163
89d61221
MR
131642011-11-12 Martin Rudalics <rudalics@gmx.at>
13165
13166 * window.h (window): Remove splits slot.
13167 * window.c (Fwindow_splits, Fset_window_splits): Remove.
13168 (Fdelete_other_windows_internal, make_parent_window)
13169 (make_window, Fsplit_window_internal, Fdelete_window_internal)
13170 (Fset_window_configuration, save_window_save): Don't deal with
13171 split status of windows.
13172 (saved_window): Remove splits slot.
13173 (Vwindow_splits): Rewrite doc-string.
13174
97f18cc8
JD
131752011-11-11 Jan Djärv <jan.h.d@swipnet.se>
13176
13177 * xfns.c (unwind_create_frame):
13178 * nsfns.m (unwind_create_frame):
13179 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
13180 Vframe_list (Bug#9999).
13181
22a648b4
DA
131822011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
13183
0b381c7e 13184 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 13185
659afede
KH
131862011-11-11 Kenichi Handa <handa@m17n.org>
13187
13188 * callproc.c (Fcall_process): Set the member dst_multibyte of
13189 process_coding.
13190
9ac0394b
KH
131912011-11-11 Johan Bockgård <bojohan@gnu.org>
13192
13193 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
13194 avoid a crash (bug#9496).
13195
2fbdc249
CY
131962011-11-09 Chong Yidong <cyd@gnu.org>
13197
13198 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
13199 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
13200
ac6b1f81
PE
132012011-11-08 Paul Eggert <eggert@cs.ucla.edu>
13202
13203 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
13204
09db192c
PE
132052011-11-08 Paul Eggert <eggert@cs.ucla.edu>
13206
13207 Avoid some portability problems by eschewing 'extern inline' functions.
13208 The trivial performance wins aren't worth the portability hassles; see
13209 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
13210 et seq.
13211 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
13212 (window_box_width, window_box_left, window_box_left_offset)
13213 (window_box_right, window_box_right_offset): Undo previous change,
13214 by removing the "extern"s.
13215 * intervals.c (adjust_intervals_for_insertion)
13216 (adjust_intervals_for_deletion): Undo previous change,
13217 making these static again.
13218 (offset_intervals, temp_set_point_both, temp_set_point)
13219 (copy_intervals_to_string): No longer inline.
13220 * xdisp.c (window_text_bottom_y, window_box_width)
13221 (window_box_height, window_box_left_offset)
13222 (window_box_right_offset, window_box_left, window_box_right)
13223 (window_box): No longer inline.
13224
105216ed
CY
132252011-11-08 Chong Yidong <cyd@gnu.org>
13226
13227 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
13228 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
13229 Signal an error if not a live window.
105216ed
CY
13230 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
13231 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
13232
ae9e237f
JB
132332011-11-07 Juanma Barranquero <lekktu@gmail.com>
13234
13235 * lisp.h (syms_of_abbrev): Remove declaration.
13236 Reported by CHENG Gao <chenggao@royau.me>.
13237
c7aa8333
EZ
132382011-11-07 Eli Zaretskii <eliz@gnu.org>
13239
13240 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
13241 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
13242 of temacs in GUI mode.
13243
be7f5545
MR
132442011-11-07 Martin Rudalics <rudalics@gmx.at>
13245
13246 * window.h: Declare delete_all_child_windows instead of
13247 delete_all_subwindows.
13248 * window.c (Fwindow_nest, Fset_window_nest)
13249 (Fset_window_new_total, Fset_window_new_normal)
13250 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
13251 (delete_all_subwindows): Rename to delete_all_child_windows.
13252 (Fdelete_other_windows_internal, Fset_window_configuration):
13253 Call delete_all_child_windows instead of delete_all_subwindows.
13254 * frame.c (delete_frame): Call delete_all_child_windows instead
13255 of delete_all_subwindows.
13256
ca78dc43
PE
132572011-11-07 Paul Eggert <eggert@cs.ucla.edu>
13258
13259 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
13260 This is also needed for porting to any host where GC_MARK_STACK is
13261 not GC_MAKE_GCPROS_NOOPS.
13262 (which_symbols): Use it.
13263
a0241d01
KH
132642011-11-07 Kenichi Handa <handa@m17n.org>
13265
13266 * coding.c (coding_set_destination): Check coding->src_pos only
13267 when coding->src_object is a buffer (bug#9910).
13268
13269 * process.c (send_process): Set the member src_multibyte of coding
13270 to 0 (bug#9911) when sending a unibyte text.
13271
13272 * callproc.c (Fcall_process): Set the member src_multibyte of
13273 process_coding to 0 (bug#9912).
13274
a64bfdfa 132752011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
13276
13277 * xmenu.c (cleanup_widget_value_tree): New function.
13278 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
13279 calling free_menubar_widget_value_tree directly (Bug#9830).
13280
cb41b32a
PE
132812011-11-06 Paul Eggert <eggert@cs.ucla.edu>
13282
13283 Fix some portability problems with 'inline'.
13284 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
13285 (window_box_width, window_box_left, window_box_left_offset)
13286 (window_box_right, window_box_right_offset): Declare extern.
13287 Otherwise, these inline functions do not conform to C99 and
13288 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
13289 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
13290 * intervals.c (adjust_intervals_for_insertion)
13291 (adjust_intervals_for_deletion): Now extern, because otherwise the
13292 extern inline functions 'offset_intervals' couldn't refer to it.
13293 (static_offset_intervals): Remove.
13294 (offset_intervals): Rewrite using the old contents of
13295 static_offset_intervals. The old version didn't conform to C99
13296 because an extern inline function contained a reference to an
13297 identifier with static linkage.
13298
b7041366
AS
132992011-11-06 Andreas Schwab <schwab@linux-m68k.org>
13300
13301 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
13302 GC.
13303
88a37c4d
EZ
133042011-11-06 Eli Zaretskii <eliz@gnu.org>
13305
13306 * xdisp.c (init_iterator, reseat_to_string): Don't set the
13307 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
13308 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
13309 return Qleft_to_right.
13310
49745b39
CY
133112011-11-06 Chong Yidong <cyd@gnu.org>
13312
13313 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
13314 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
13315 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
13316 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
13317 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
13318 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
13319 (Fwindow_vscroll): Doc fix.
13320 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
13321 argument, since it makes no sense to pass a live window and for
13322 consistency with window-child.
13323
1f05cd82
CS
133242011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
13325
13326 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
13327 support MSVC.
13328
22610910
JR
133292011-11-05 Jason Rumney <jasonr@gnu.org>
13330
13331 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
13332 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
13333 fonts (Bug#6029).
13334 (add_font_entity_to_list): Fix logic errors in mixed boolean and
13335 bitwise arithmetic preventing use of unicode-sip and non-truetype
13336 opentype fonts.
13337
a06776b2
EZ
133382011-11-05 Eli Zaretskii <eliz@gnu.org>
13339
3ad924ba
EZ
13340 * s/ms-w32.h (fstat, stat, utime): Move redirections to
13341 "emacs"-only part.
13342
a06776b2
EZ
13343 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
13344 initialization code to keep similarity to xfns.c after changes
13345 from 2011-11-05.
13346
c9e7db78
JD
133472011-11-05 Jan Djärv <jan.h.d@swipnet.se>
13348
a97f8f3f
JD
13349 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
13350 (unwind_create_frame): New function (Bug#9943).
13351 (Fx_create_frame): Restructure code to be more similar to the one in
13352 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
13353 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
13354 Move terminal->reference_count++ just before making the frame official
13355 (Bug#9943).
13356
13357 * nsterm.m (x_free_frame_resources): New function.
13358 (x_destroy_window): Move code to x_free_frame_resources.
13359
c9e7db78 13360 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
13361 (Fx_create_frame, x_create_tip_frame):
13362 Move terminal->reference_count++ just before making the frame
75f1671a 13363 official. Move initialization of image_cache_refcount and
c9e7db78
JD
13364 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
13365
a6fc3b5c
EZ
133662011-11-05 Eli Zaretskii <eliz@gnu.org>
13367
13368 Support MSVC build with newer versions of Visual Studio.
13369 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
13370 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
13371 nt/gmake.defs.
13372
13373 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
13374 which are not supported by MSVC.
13375 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
13376 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
13377 bitfields.
13378 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
13379 types in bitfields.
13380 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
13381
13382 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
13383
58179cce 133842011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
13385
13386 Support MSVC build with newer versions of Visual Studio.
13387 * w32.c: Don't include w32api.h for MSVC.
13388 (init_environment) [_MSC_VER]: Call sys_access, not _access.
13389
13390 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
13391 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
13392 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
13393 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
13394 e_* cousins.
13395 (alloca) [_MSC_VER]: Define to _alloca.
13396
13397 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
13398
13399 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
13400
a58c13ed
EZ
134012011-11-04 Eli Zaretskii <eliz@gnu.org>
13402
13403 * xdisp.c (note_mouse_highlight): If either of
13404 previous/next-single-property-change returns nil, treat that as
13405 the beginning or the end of the buffer. (Bug#9955)
13406
fe0b6370
JD
134072011-11-04 Jan Djärv <jan.h.d@swipnet.se>
13408
a58c13ed 13409 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
13410 label is not null (Bug#9951).
13411 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
13412 may be NULL.
13413
89bd5ee1
EZ
134142011-11-04 Eli Zaretskii <eliz@gnu.org>
13415
13416 * window.c (Fwindow_body_size): Mention in the doc string that the
13417 return value is in frame's canonical units. (Bug#9949)
13418
84c3edb9
EZ
134192011-11-03 Eli Zaretskii <eliz@gnu.org>
13420
4e2fb5c7
EZ
13421 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
13422
84c3edb9 13423 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 13424 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 13425 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 13426
bc17a887
EZ
134272011-11-01 Eli Zaretskii <eliz@gnu.org>
13428
13429 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
13430 Don't stop backward scan on the continuation glyph, even though
13431 its CHARPOS is positive.
6d5eb5b0
SM
13432 (mouse_face_from_buffer_pos, note_mouse_highlight):
13433 Rename cover_string to disp_string.
bc17a887 13434
4ee88440
MR
134352011-11-01 Martin Rudalics <rudalics@gmx.at>
13436
13437 * window.c (temp_output_buffer_show): Don't use
13438 Vtemp_buffer_show_specifiers.
13439 (Vtemp_buffer_show_specifiers): Remove unused variable.
13440
c2ff3c02
EZ
134412011-10-30 Eli Zaretskii <eliz@gnu.org>
13442
13443 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
13444 past the beginning of the current glyph matrix.
13445
58179cce 134462011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
13447
13448 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
13449 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
13450 HAVE_GTK3 (Bug#9869).
b77a6a7f 13451
3b574623
JD
13452 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
13453 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
13454
b77a6a7f
JD
13455 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
13456
13457 * xterm.c: Declare x_handle_net_wm_state to return int.
13458 (handle_one_xevent): Check if we are iconified but don't have
13459 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
13460 (get_current_wm_state): Return non-zero if not hidden,
13461 check for _NET_WM_STATE_HIDDEN (Bug#9893).
13462 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
13463 (x_handle_net_wm_state): Return what get_current_wm_state returns.
13464 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
13465
196e41e4
PE
134662011-10-29 Paul Eggert <eggert@cs.ucla.edu>
13467
13468 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
13469 so that this new function doesn't get optimized away by a
13470 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
13471
021f2e1a
AS
134722011-10-29 Andreas Schwab <schwab@linux-m68k.org>
13473
13474 * frame.h (MOUSE_HL_INFO): Remove excess parens.
13475
8b058d44
EZ
134762011-10-29 Eli Zaretskii <eliz@gnu.org>
13477
13478 Fix the `xbytecode' command.
13479 * .gdbinit (xprintbytestr): New command.
b50a28de 13480 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
13481 (xbytecode): Print the byte-code string as well.
13482
4452fb80
EZ
134832011-10-29 Kim Storm <storm@cua.dk>
13484
8b058d44
EZ
13485 * alloc.c (which_symbols): New function.
13486
21b72067
AS
134872011-10-29 Andreas Schwab <schwab@linux-m68k.org>
13488
13489 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
13490 line. (Bug#9903)
13491
83ed7b5c
GM
134922011-10-29 Glenn Morris <rgm@gnu.org>
13493
13494 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
13495 Not clear what it was for, and it causes various bugs. (Bug#9839)
13496
5a7a728b
EZ
134972011-10-28 Eli Zaretskii <eliz@gnu.org>
13498
13499 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
13500 possible random value that matches one of those tested as
13501 condition to clear the mouse face.
13502
d3d0842f
CY
135032011-10-28 Chong Yidong <cyd@gnu.org>
13504
13505 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
13506
31b39d13
DN
135072011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
13508
13509 * window.c (make_window): Initialize phys_cursor_on_p.
13510
9aba6043
SM
135112011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
13512
13513 * lisp.h (struct Lisp_Symbol): Update comments.
13514
c20992f4
JB
135152011-10-28 Juanma Barranquero <lekktu@gmail.com>
13516
13517 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
13518
db4f02f2
EZ
135192011-10-28 Eli Zaretskii <eliz@gnu.org>
13520
13521 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
13522 <oslsachem@gmail.com> for helping to debug this.
13523
13524 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
13525 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
13526 (g_b_init_get_glyph_outline_w): New static variables.
13527 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
13528 (GetGlyphOutlineW_Proc): New typedefs.
13529 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
13530 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
13531 New functions.
13532 (w32font_open_internal, compute_metrics):
13533 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
13534 instead of calling the "wide" APIs directly.
13535
13536 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
13537
13538 * w32.h (syms_of_w32font): Add prototype.
13539
87e68db4
JB
135402011-10-27 Juanma Barranquero <lekktu@gmail.com>
13541
13542 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
13543 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
13544 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
13545 (Fmove_to_window_line): Doc fix.
13546
435c1d67
CY
135472011-10-27 Chong Yidong <cyd@gnu.org>
13548
13549 * process.c (make_process): Set gnutls_state to NULL.
13550
13551 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
13552 non-NULL, regardless of GNUTLS_INITSTAGE.
13553 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
13554 an error. Set process slots as soon as we allocate them.
13555
13556 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
13557
9c6c6f49
CY
135582011-10-27 Chong Yidong <cyd@gnu.org>
13559
9aba6043
SM
13560 * gnutls.c (emacs_gnutls_deinit): New function.
13561 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
13562 (Fgnutls_deinit, Fgnutls_boot): Use it.
13563
13564 * process.c (make_process): Initialize GnuTLS credentials to NULL.
13565 (deactivate_process): Call emacs_gnutls_deinit.
13566
657d08d3
JB
135672011-10-27 Juanma Barranquero <lekktu@gmail.com>
13568
13569 * image.c (x_create_x_image_and_pixmap):
13570 * w32.c (sys_rename, w32_delayed_load):
13571 * w32font.c (fill_in_logfont):
13572 * w32reg.c (x_get_string_resource): Silence compiler warnings.
13573
5430d399
JB
135742011-10-26 Juanma Barranquero <lekktu@gmail.com>
13575
13576 * w32fns.c (w32_default_color_map): New function,
13577 extracted from Fw32_default_color_map.
a7ef684b 13578 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 13579
fe0055fa
PE
135802011-10-25 Paul Eggert <eggert@cs.ucla.edu>
13581
13582 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
13583
e6346438
SM
135842011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
13585
13586 * keyboard.c (test_undefined): New function (bug#9751).
13587 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
13588
e112cc37
ET
135892011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
13590
13591 * sysdep.c (init_sys_modes): Fix the check for the controlling
13592 terminal (Bug#6649).
13593
7b5d6677
EZ
135942011-10-20 Eli Zaretskii <eliz@gnu.org>
13595
13596 * dispextern.h (struct bidi_it): New member next_en_type.
13597
13598 * bidi.c (bidi_line_init): Initialize the next_en_type member.
13599 (bidi_resolve_explicit_1): When next_en_pos is valid for the
13600 current character, check also for next_en_type being WEAK_EN.
13601 (bidi_resolve_weak): Don't enter the expensive loop if the current
13602 position is before next_en_pos. Record the bidi type of the first
13603 non-ET, non-BN character we find, in addition to its position.
13604 (bidi_level_of_next_char): Invalidate next_en_type when
13605 next_en_pos is over-stepped.
13606
7da0b018
PE
136072011-10-20 Paul Eggert <eggert@cs.ucla.edu>
13608
13609 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
13610 * editfns.c: Rewrite current-time-zone so that it invokes
13611 the equivalent of (format-time-string "%Z") to get the time zone name.
13612 This fixes a bug when the time zone name contains characters that
13613 need converting from the system time locale to Emacs internal format.
13614 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
13615 that patch fixed format-time-string to do the conversion, but
13616 I forgot to fix current-time-zone.
13617 (format_time_string): New function, containing most of
13618 what Fformat_time_string used to contain.
13619 (Fformat_time_string): Rewrite in terms of format_time_string.
13620 This doesn't change this function's behavior.
13621 (current-time-zone): Rewrite to use format_time_string.
13622 This fixes the bug reported by Michael Schierl in
13623 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
13624 Jason Rumney's 2007-06-07 change worked around this bug, but
13625 didn't fix it.
13626 * systime.h (tzname, timezone): Remove no-longer-used declarations.
13627
8547b010
EZ
136282011-10-19 Eli Zaretskii <eliz@gnu.org>
13629
13630 * xdisp.c (start_display): If the character at POS is displayed
13631 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
13632 (try_window_reusing_current_matrix): If a line ends in a display
13633 vector or the next line starts in a display vector, continue
13634 redrawing the window even though the character position of
13635 start_row was reached.
8547b010
EZ
13636 (Bug#9771, part 2)
13637
4e948d15
CY
136382011-10-18 Chong Yidong <cyd@gnu.org>
13639
13640 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
13641 with nobreak-char-display too.
13642
4787455f
EZ
136432011-10-18 Eli Zaretskii <eliz@gnu.org>
13644
13645 Fix part 3 of bug#9771.
13646 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
13647 (bidi_resolve_neutral): Don't enter the expensive loop looking for
13648 non-neutral characters if the current character is a paragraph
13649 separator (a.k.a. Newline). This avoids running the same
13650 expensive loop twice, once when we consume the preceding newline
13651 and the other time when the line actually needs to be displayed.
13652 Avoid the loop when we see neutrals on the base embedding level
13653 following a character whose directionality is the same as the
13654 paragraph's. This avoids running the expensive loop when a line
13655 ends in a long sequence of neutrals, like control characters.
13656 Add assertion against STRONG_AL type. Slightly rearrange code
13657 that determines the type of a neutral given the first non-neutral
13658 that follows it.
13659 (bidi_level_of_next_char): Set next_en_pos to zero when
13660 invalidating its info.
13661
2c91f553
EZ
136622011-10-17 Eli Zaretskii <eliz@gnu.org>
13663
13664 * xdisp.c (push_display_prop): Determine whether to record string
13665 or buffer position by IT->string, not by IT->method. Allow
13666 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
13667 (move_it_vertically_backward): Don't look for character position
13668 immediately after the newline when in a continuation line.
13669 (Bug#9771, part 1)
2c91f553 13670
c7b08b0d
MR
136712011-10-15 Martin Rudalics <rudalics@gmx.at>
13672
13673 * window.c (coordinates_in_window): Rewrite and delabelize
13674 vertical border check. (Bug#5357) (Bug#9618)
13675
6b02f655
SM
136762011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
13677
13678 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
13679 errors in XSetWindowBorder (bug#9310).
13680
81d40c92
DA
136812011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
13682
13683 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
13684 avoid crash when xmalloc overrun checking is enabled.
13685
d4172c3b
EZ
136862011-10-13 Eli Zaretskii <eliz@gnu.org>
13687
13688 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
13689 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
13690 cursor motion with <left> and <right> arrow keys.
13691
13692 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
13693 some callers set that themselves.
13694
b00eea75
EZ
136952011-10-12 Eli Zaretskii <eliz@gnu.org>
13696
13697 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
13698 display string and the previous row comes from the same string and
13699 is empty. (Bug#9739) (Bug#9738)
13700
8fe012c4
SM
137012011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
13702
13703 * doc.c (get_doc_string): Encode file name (bug#9735).
13704
0074aef2
EZ
137052011-10-12 Eli Zaretskii <eliz@gnu.org>
13706
79beb178
EZ
13707 * bidi.c (bidi_level_of_next_char):
13708 * xdisp.c (get_visually_first_element): Remove old incorrect
13709 comments regarding the Unicode Line Separator character.
13710
0074aef2
EZ
13711 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
13712
6e4b3fbe
DA
137132011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
13714
13715 * alloc.c (Fgc_status): Do not access beyond zombies array
13716 boundary if nzombies > MAX_ZOMBIES.
13717 * alloc.c (dump_zombies): Add missing format specifier.
13718
0324f3af
PE
137192011-10-12 Paul Eggert <eggert@cs.ucla.edu>
13720
b5525cac
PE
13721 * xdisp.c (set_cursor_from_row): Simplify conditionals,
13722 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
13723
0324f3af
PE
13724 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
13725 Some packages use them to denote characters with modifiers.
13726
e9b5f888
AS
137272011-10-11 Andreas Schwab <schwab@linux-m68k.org>
13728
13729 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
13730 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
13731 matching a pp-number. Rename parameter var to var1.
13732
127827c0
SM
137332011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
13734
13735 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
13736
c8fd3bd0
GM
137372011-10-08 Glenn Morris <rgm@gnu.org>
13738
13739 * callint.c (Fcall_interactively): Give a more explicit error for the
13740 'c' case with a non-character input. (Bug#8479)
13741
352ec8ff
EZ
137422011-10-08 Eli Zaretskii <eliz@gnu.org>
13743
03669ccb
EZ
13744 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
13745 lines.
7061c986
EZ
13746 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
13747 lines that are hscrolled on the left.
03669ccb 13748
352ec8ff
EZ
13749 * dispnew.c (buffer_posn_from_coords): Account for a possible
13750 presence of header-line. (Bug#4426)
13751
a66cfb1c
SM
137522011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
13753
6b02f655
SM
13754 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
13755 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 13756
7c5ee88e
PE
137572011-10-07 Paul Eggert <eggert@cs.ucla.edu>
13758
13759 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
13760 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
13761 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
13762 this makes Emacs dump core during garbage collection on rare
13763 occasions. sizeof is obviously inferior to offsetof here, so
13764 stick with offsetof.
13765 (GC_POINTER_ALIGNMENT): New macro.
13766 (mark_memory): Omit 3rd (offset) arg; caller changed.
13767 Don't assume EMACS_INT alignment is the same as pointer alignment.
13768
df1bbe5b
SM
137692011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
13770
13771 * keyboard.c (read_key_sequence_remapped): New var.
13772 (read_key_sequence): Compute remapping in the right buffer.
13773 (command_loop_1): Use read_key_sequence's remapping directly.
13774
51553db6
SM
137752011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
13776
32c1fffd
SM
13777 * dired.c (file_name_completion): Don't expand file name.
13778 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
13779 before checking file name handler.
13780
51553db6
SM
13781 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
13782 they've been requested explicitly (bug#9591).
13783
b6bd1599 137842011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
13785
13786 * keymap.c (Fsingle_key_description): Use make_specified_string
13787 instead of build_string to build string from push_key_description.
13788 (Bug#5193)
13789
f701dc2a
PE
137902011-09-30 Paul Eggert <eggert@cs.ucla.edu>
13791
4222c55d
PE
13792 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
13793 This fixes a Y2038 bug on 64-bit hosts.
13794 * buffer.c (reset_buffer):
13795 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
13796 (Fclear_buffer_auto_save_failure):
13797 Use 0, not -1, to represent an unset failure time, since time_t
13798 might not be signed.
13799
f701dc2a
PE
13800 Remove dependency on glibc malloc internals.
13801 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13802 Move back here from lisp.h, but with their new implementations.
13803 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13804 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
13805 * charset.c (charset_table_init): New static var.
13806 (syms_of_charset): Use it instead of xmalloc. This removes a
13807 dependency on glibc malloc internals. See Eli Zaretskii's comment in
13808 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
13809 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13810 Move back to alloc.c.
13811 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13812 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
13813
9ceebf39
JD
138142011-09-30 Jan Djärv <jan.h.d@swipnet.se>
13815
13816 * nsterm.m (windowDidResize): Call x_set_window_size only when
13817 ns_in_resize is true. Otherwise set pixelwidth/height and
13818 call change_frame_size (Bug#9628).
13819
cb993c58
PE
138202011-09-30 Paul Eggert <eggert@cs.ucla.edu>
13821
3930c88b
PE
13822 Port --enable-checking=all to Fedora 14 x86-64.
13823 * charset.c (syms_of_charset): Also account for glibc malloc's
13824 internal overhead when calculating the initial malloc maximum.
13825
cb993c58
PE
13826 Port --enable-checking=all to Fedora 14 x86.
13827 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13828 Move to lisp.h.
13829 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
13830 (overrun_check_realloc, overrun_check_free):
13831 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
13832 That way, xmalloc returns a properly-aligned pointer even if
13833 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
13834 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
13835 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
13836 into account when calculating the initial malloc maximum.
13837 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13838 Move here from alloc.c, so that charset.c can use it too.
13839 Properly align; the old code wasn't right for common 32-bit hosts
13840 when configured with --enable-checking=all.
13841 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13842 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
13843
31bed486
EZ
138442011-09-29 Eli Zaretskii <eliz@gnu.org>
13845
04c70788 13846 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
13847 use EDOM.
13848
fbcaa2f3
EZ
138492011-09-28 Eli Zaretskii <eliz@gnu.org>
13850
13851 * xdisp.c (compute_display_string_end): If there's no display
13852 string at CHARPOS, return -1.
13853
13854 * bidi.c (bidi_fetch_char): When compute_display_string_end
13855 returns a negative value, treat the character as a normal
13856 character not covered by a display string. (Bug#9624)
13857
a239d4e9
JB
138582011-09-28 Juanma Barranquero <lekktu@gmail.com>
13859
13860 * lread.c (Fread_from_string): Fix typo in docstring.
13861
88652fd5
EZ
138622011-09-27 Eli Zaretskii <eliz@gnu.org>
13863
13864 * xdisp.c (handle_invisible_prop): If invisible text ends on a
13865 newline, reseat the iterator instead of bidi-iterating there one
13866 character at a time. (Bug#9610)
32c1fffd
SM
13867 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
13868 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 13869
ed497dd4
AS
138702011-09-27 Andreas Schwab <schwab@linux-m68k.org>
13871
13872 * lread.c (readevalloop): Use correct code for NBSP.
13873 (read1): Likewise. (Bug#9608)
13874
b2bf61aa
MA
138752011-09-25 Michael Albinus <michael.albinus@gmx.de>
13876
13877 * dbusbind.c (Fdbus_register_signal): When service is not
13878 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
13879
32bbb17c
GM
138802011-09-25 Glenn Morris <rgm@gnu.org>
13881
13882 * buffer.c (truncate-lines): Doc fix.
13883
94e0933e
CY
138842011-09-24 Chong Yidong <cyd@stupidchicken.com>
13885
13886 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
13887 (Fset_window_next_buffers): Doc fix.
13888
cddde921
GM
138892011-09-24 Glenn Morris <rgm@gnu.org>
13890
13891 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
13892
1260aef1
PE
138932011-09-24 Paul Eggert <eggert@cs.ucla.edu>
13894
25b4bfa0
PE
13895 Fix minor problems found by static checking.
13896 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
13897 * indent.c (Fvertical_motion): Fix == vs = typo.
13898
e3cbd34b
EZ
138992011-09-24 Eli Zaretskii <eliz@gnu.org>
13900
a66cfb1c
SM
13901 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
13902 Default value is now t. Doc fix.
6bf7006f 13903
e3cbd34b 13904 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 13905 logic when moving up, not only when moving down. Fix the
e3cbd34b 13906 confusing name and values of the it_overshoot_expected variable;
32c1fffd 13907 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
13908
13909 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
13910 CHARPOS is covered by a display string which includes newlines.
13911 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
13912 is covered by a display string with embedded newlines.
13913
a3de0cbd
MA
139142011-09-24 Michael Albinus <michael.albinus@gmx.de>
13915
13916 * dbusbind.c (Fdbus_register_signal): Add match rule to
13917 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
13918 (Fdbus_register_method, Vdbus_registered_objects_table):
13919 Fix docstring.
a3de0cbd 13920
b260039d
JM
139212011-09-24 Jim Meyering <meyering@redhat.com>
13922
32c1fffd 13923 do not ignore write error for any output size
b260039d
JM
13924 The previous change was incomplete.
13925 While it makes emacs --batch detect the vast majority of stdout
13926 write failures, errors were still ignored whenever the output size is
13927 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
13928 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
13929 && echo FAIL: ignored write error
13930 FAIL: ignored write error
13931 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
13932 && echo FAIL: ignored write error
13933 FAIL: ignored write error
13934 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
13935
8eca8a7c
AS
139362011-09-23 Andreas Schwab <schwab@linux-m68k.org>
13937
13938 * emacs.c (Fkill_emacs): In noninteractive mode exit
13939 non-successfully if a write error occurred on stdout. (Bug#9574)
13940
3341db62
EZ
139412011-09-21 Eli Zaretskii <eliz@gnu.org>
13942
13943 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
13944 the xassert test.
13945
13946 * dispextern.h (struct it): Update the comment documenting what
13947 can it->OBJECT be.
13948
8c203dbf
EZ
139492011-09-20 Eli Zaretskii <eliz@gnu.org>
13950
13951 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
13952 a display string, extend search for cursor position to end of row.
13953 (find_row_edges): If the row ends in a newline from a display
13954 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
13955 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
13956 (Fcurrent_bidi_paragraph_direction): Fix search for previous
13957 non-empty line. Fixes confusing cursor motion with arrow keys at
13958 the beginning of a line that starts with whitespace.
8c203dbf 13959
a4824228
LMI
139602011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13961
13962 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
13963 (bug#9493).
13964
33ed493b
CY
139652011-09-18 Chong Yidong <cyd@stupidchicken.com>
13966
13967 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
13968 boolean (Bug#9154).
13969
56cd55c8
EZ
139702011-09-18 Eli Zaretskii <eliz@gnu.org>
13971
13972 * xdisp.c (display_line): Record maximum and minimum buffer
13973 positions even if no glyphs were produced (e.g., by a zero-width
13974 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
13975 buffer positions that will be removed from the glyph row because
13976 they don't fit.
c02dcedf
EZ
13977 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
13978 column is beyond frame width: don't subtract 1 "pixel" when
13979 computing width of the stretch.
3e62b7e0
EZ
13980 (reseat_at_next_visible_line_start): Undo the change made on
13981 2011-09-17 that saved paragraph information and restored it after
13982 the call to `reseat'. (Bug#9545)
56cd55c8 13983
5ed99d36 139842011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
13985
13986 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
13987 and turn window cursor on if cleared (Bug#9415).
13988
5ed99d36 139892011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
13990
13991 * search.c (boyer_moore): Take unibyte characters from pattern
13992 literally. (Bug#9458)
13993
9bade7b2
EZ
139942011-09-18 Eli Zaretskii <eliz@gnu.org>
13995
13996 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
13997
e5e9d610
PE
139982011-09-18 Paul Eggert <eggert@cs.ucla.edu>
13999
87e4427a
PE
14000 Fix minor problem found by static checking.
14001 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
14002 initialized, to pacify gcc -Wuninitialized.
14003
e5e9d610
PE
14004 * fileio.c: Report proper errno when syscall falls.
14005 (Finsert_file_contents): Save and restore errno,
14006 so that report_file_error outputs the correct diagnostic.
14007 (Fwrite_region) [CLASH_DETECTION]: Likewise.
14008
a1674f0b
EZ
140092011-09-18 Eli Zaretskii <eliz@gnu.org>
14010
14011 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
14012
fbfb6dd4
EZ
140132011-09-17 Eli Zaretskii <eliz@gnu.org>
14014
14015 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
14016 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
14017
bb187662
EZ
140182011-09-17 Eli Zaretskii <eliz@gnu.org>
14019
1137e8b8 14020 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 14021 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
14022
14023 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
14024 (bidi_find_paragraph_start): Search back for paragraph beginning
14025 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
14026 (bidi_move_to_visually_next): Only trigger paragraph-related
14027 computations when the last character is a newline or at EOB, not
14028 just any NEUTRAL_B. (Bug#9470)
14029
bb187662
EZ
14030 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
14031 truncated lines if point is covered by a display string. (Bug#9524)
14032
2e621251
PE
140332011-09-16 Paul Eggert <eggert@cs.ucla.edu>
14034
14035 * xselect.c: Relax test for outgoing X longs (Bug#9498).
14036 (cons_to_x_long): New function.
14037 (lisp_data_to_selection_data): Use it. Correct the test for
14038 short-versus-long data; it was negated. Break out of vector
14039 loop, for efficiency, when a long datum is discovered.
14040
91a15bc6
SM
140412011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
14042
14043 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
14044
b41c3a35
EZ
140452011-09-16 Eli Zaretskii <eliz@gnu.org>
14046
14047 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
14048 GCC PR/17406) by declaring this function with external scope.
14049
7812ba2d
PE
140502011-09-15 Paul Eggert <eggert@cs.ucla.edu>
14051
14052 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
14053 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
14054
cf7edc2a
AS
140552011-09-15 Andreas Schwab <schwab@linux-m68k.org>
14056
14057 * editfns.c (Fformat): Correctly handle text properties on "%%".
14058
bd01620e
EZ
140592011-09-15 Eli Zaretskii <eliz@gnu.org>
14060
14061 * xterm.c (x_draw_composite_glyph_string_foreground):
14062 * w32term.c (x_draw_composite_glyph_string_foreground):
14063 * term.c (encode_terminal_code):
14064 * composite.c (composition_update_it, get_composition_id):
14065 * xdisp.c (get_next_display_element)
14066 (fill_composite_glyph_string): Add comments about special meaning
14067 of TAB characters in a composition.
14068
a02719a3
PE
140692011-09-15 Paul Eggert <eggert@cs.ucla.edu>
14070
14071 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
14072 This occurs when processing a multibyte format.
14073 Problem reported by Wolfgang Jenker.
a02719a3 14074
72589a3c
JB
140752011-09-15 Johan Bockgård <bojohan@gnu.org>
14076
14077 * xdisp.c (try_cursor_movement): Only check for exact match if
14078 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
14079
1c14176c
PE
140802011-09-14 Paul Eggert <eggert@cs.ucla.edu>
14081
14082 Remove unused external symbols.
14083 * dispextern.h (calc_pixel_width_or_height): Remove decl.
14084 * xdisp.c (calc_pixel_width_or_height): Now static.
14085 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
14086 * indent.c (check_display_width):
14087 * w32term.c: Fix comment to match code.
14088 * xterm.c, xterm.h (x_catching_errors): Remove.
14089
d2eea5b5
PE
140902011-09-14 Paul Eggert <eggert@cs.ucla.edu>
14091
14092 * xselect.c: Use signed conversions more consistently (Bug#9498).
14093 (selection_data_to_lisp_data): Assume incoming selection data are
14094 signed integers, not unsigned. This is to be consistent with
14095 outgoing selection data, which was modified to use signed integers
14096 in as part of the fix to Bug#9196 in response to Jan D.'s comment
14097 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
14098 expects long, not unsigned long.
14099
46888499
EZ
141002011-09-14 Eli Zaretskii <eliz@gnu.org>
14101
14102 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
14103 computation of loop end. Reported by Johan Bockgård
14104 <bojohan@gnu.org>.
14105
ef8ef9fb
CY
141062011-09-13 Chong Yidong <cyd@stupidchicken.com>
14107
14108 * frame.c (Fother_visible_frames_p): Function deleted.
14109
fa819fed
EZ
141102011-09-12 Eli Zaretskii <eliz@gnu.org>
14111
14112 * indent.c (compute_motion): Process display vector front to back
14113 rather than the other way around. (Bug#2496)
14114
2ba8e008
SM
141152011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
14116
14117 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
14118
20f53c69
CY
141192011-09-11 Chong Yidong <cyd@stupidchicken.com>
14120
14121 * minibuf.c (Fread_from_minibuffer): Doc fix.
14122
d562d7a4
EZ
141232011-09-11 Eli Zaretskii <eliz@gnu.org>
14124
14125 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
14126 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
14127
1c4d7f3d
LMI
141282011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
14129
14130 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
14131 value for non-existent files.
14132
b885bf36
EZ
141332011-09-11 Eli Zaretskii <eliz@gnu.org>
14134
14135 * fileio.c (Finsert_file_contents): If the file cannot be opened,
14136 set its "size" to -1. This will set the modtime_size field of
14137 the corresponding buffer to -1, which is what
14138 verify-visited-file-modtime expects for files that do not exist.
14139 (Bug#9139)
14140
6612f0bf
PE
141412011-09-11 Paul Eggert <eggert@cs.ucla.edu>
14142
14143 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
14144 here ...
14145 * lisp.h: ... from here. push_key_description is no longer
14146 defined in keyboard.c, so its declaration should not be in
14147 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
14148 logically belongs with push_key_description.
14149
dfb3f755
PE
141502011-09-10 Paul Eggert <eggert@cs.ucla.edu>
14151
14152 * buffer.h: Include <sys/types.h> instead of <time.h>.
14153 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
14154 Problem reported by Herbert J. Skuhra.
14155
3134906c
LMI
141562011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
14157
14158 * xml.c (parse_region): Make the parsing work for
14159 non-comment-starting XML files again (bug#9144).
14160
8d903f4e
AS
141612011-09-10 Andreas Schwab <schwab@linux-m68k.org>
14162
14163 * image.c (gif_load): Fix calculation of bottom and right corner.
14164 (Bug#9468)
14165
80ad64f4
EZ
141662011-09-10 Eli Zaretskii <eliz@gnu.org>
14167
14168 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
14169 redisplay in small windows.
14170
208a048d
EZ
141712011-09-09 Eli Zaretskii <eliz@gnu.org>
14172
14173 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
14174
9b1c252e
MR
141752011-09-08 Martin Rudalics <rudalics@gmx.at>
14176
14177 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
14178 Operate on live windows only.
14179
2949f33b
JB
141802011-09-08 Juanma Barranquero <lekktu@gmail.com>
14181
14182 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
14183
e08dcafd
EZ
141842011-09-07 Eli Zaretskii <eliz@gnu.org>
14185
14186 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
14187 only under bidi iteration.
14188
115b96bd
JD
141892011-09-07 Jan Djärv <jan.h.d@swipnet.se>
14190
14191 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
14192
c8199d0f
PE
141932011-09-06 Paul Eggert <eggert@cs.ucla.edu>
14194
14195 isnan: Fix porting problem to Solaris 10 with bundled gcc.
14196 Without this fix, the command to link temacs failed due to an
14197 undefined symbol __builtin_isnan. This is because
14198 /usr/include/iso/math_c99.h #defines isnan(x) to
14199 __builtin_isnan(x), but the bundled gcc, which identifies itself
14200 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
14201 a __builtin_isnan.
14202 * floatfns.c (isnan): #undef, and then #define to a clone of
14203 what's in data.c.
14204 (Fisnan): Always define, since it's always available now.
14205 (syms_of_floatfns): Always define isnan at the Lisp level.
14206
e39b275c 142072011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
14208
14209 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
14210
b2db44d9 142112011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 14212
f4af5137 14213 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
14214 The previous code assumed that file offsets (off_t values) fit in
14215 EMACS_INT variables, which is not true on typical 32-bit hosts.
14216 The code messed up by falsely reporting buffer overflow in cases
14217 such as (insert-file-contents "big" nil 1 2) into an empty buffer
14218 when "big" contains more than 2**29 bytes, even though this
14219 inserts just one byte and does not overflow the buffer.
14220 (Finsert_file_contents): Store file offsets as off_t
14221 values, not as EMACS_INT values. Check for overflow when
14222 converting between EMACS_INT and off_t. When checking for
14223 buffer overflow or for overlap, take the offsets into account.
14224 Don't use EMACS_INT for small values where int suffices.
14225 When checking for overlap, fix a typo: ZV was used where
14226 ZV_BYTE was intended.
14227 (Fwrite_region): Don't assume off_t fits into 'long'.
14228 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
14229
ecfc0a49
MA
142302011-09-05 Michael Albinus <michael.albinus@gmx.de>
14231
14232 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
14233
6511acf2 142342011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 14235
0999621a 14236 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
14237
14238 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 14239 (esprintf, exprintf, evxprintf): New functions.
62f19c19 14240 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 14241 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
14242 (modify_event_symbol): Do not assume that the length of
14243 name_alist_or_stem is safe to alloca and fits in int.
14244 (Fexecute_extended_command): Likewise for function name and binding.
14245 (Frecursion_depth): Wrap around reliably on integer overflow.
14246 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
14247 since some callers pass EMACS_INT values.
14248 (Fsingle_key_description): Don't crash if symbol name contains more
14249 than MAX_ALLOCA bytes.
14250 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
14251 (get_minibuffer): Arg is now EMACS_INT, not int.
14252 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 14253 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
14254 * window.h (command_loop_level, minibuf_level): Reflect API changes.
14255
2be7d702
PE
14256 * dbusbind.c (signature_cat): New function.
14257 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
14258 Do not overrun buffer; instead, report string overflow.
14259
9d1df220
PE
14260 * dispnew.c (add_window_display_history): Don't overrun buffer.
14261 Truncate instead; this is OK since it's just a log.
14262
33ef5c64
PE
14263 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
14264 even if the time zone offset is outlandishly large.
14265 Don't mishandle offset == INT_MIN.
14266
66c6fdd5
PE
14267 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
14268 when creating daemon; the previous buffer-overflow check was incorrect.
14269
d749b01b
PE
14270 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
14271 which has the guts of the old verror function.
14272
b5cd1905
PE
14273 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
14274 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
14275
6e1a67fb
PE
14276 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
14277 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 14278 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 14279 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
14280 length of string rather than counting it via multiple sprintfs;
14281 that's simpler and more reliable.
c21721cc
PE
14282 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
14283 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
14284 sprintf, in case result does not fit in int.
14285
c57b67fc
PE
14286 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
14287 (fontset_from_font): Print it.
14288
8a401434
PE
14289 * frame.c (tty_frame_count): Now printmax_t, not int.
14290 (make_terminal_frame, set_term_frame_name): Print it.
14291 (x_report_frame_params): In X, window IDs are unsigned long,
14292 not signed long, so print them as unsigned.
14293 (validate_x_resource_name): Check for implausibly long names,
14294 and don't assume name length fits in 'int'.
14295 (x_get_resource_string): Don't blindly alloca invocation name;
14296 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
14297 not fit in int.
14298
6e1a67fb
PE
14299 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
14300 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
14301 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
14302
0df02bf3
PE
14303 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
14304 Use esprintf, not sprintf, in case result does not fit in int.
14305
48e30793
PE
14306 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
14307 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
14308 it as a large positive number.
14309 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
14310 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
14311
a66ff6d8
PE
14312 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
14313 in case result does not fit in int.
14314
aca216ff
PE
14315 * print.c (float_to_string): Detect width overflow more reliably.
14316 (print_object): Make sprintf buffer a bit bigger, to avoid potential
14317 buffer overrun. Don't assume list length fits in 'int'. Treat
14318 print length of 0 as 0, not as infinity; to be consistent with other
14319 uses of print length in this function. Don't overflow print length
14320 index. Don't assume hash table size fits in 'long', or that
14321 vectorlike size fits in 'unsigned long'.
14322
31c286f7
PE
14323 * process.c (make_process): Use printmax_t, not int, to format
14324 process-name gensyms.
14325
55e5faa1
PE
14326 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
14327
80f2e268
PE
14328 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
14329 to avoid potential buffer overrun.
14330
670741ab
PE
14331 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
14332 if X resource line is longer than 512 bytes.
14333
b7163a50
PE
14334 * xfns.c (x_window): Make sprintf buffer a bit bigger
14335 to avoid potential buffer overrun.
14336
ae58ff1f
PE
14337 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
14338
c43c8a6a
PE
14339 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
14340
3f8236f4
PE
143412011-09-04 Paul Eggert <eggert@cs.ucla.edu>
14342
53e9fe90 14343 Integer overflow fixes for scrolling, etc.
6511acf2
PE
14344 Without these, Emacs silently mishandles large integers sometimes.
14345 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
14346 it were "C-u 1 M-x recenter" on a typical 64-bit host.
14347
6511acf2
PE
14348 * xdisp.c (try_window_id): Check Emacs fixnum range before
14349 converting to 'int'.
806add1d 14350
6511acf2 14351 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
14352 Check that an Emacs fixnum is in range before assigning it to 'int'.
14353 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
14354 values converted from Emacs fixnums.
14355 (Frecenter): Don't wrap around a line count if it is out of 'int'
14356 range; instead, treat it as an extreme value.
14357 (Fset_window_configuration, compare_window_configurations):
14358 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
14359
6511acf2
PE
14360 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
14361 that can exceed INT_MAX. Check that EMACS_INT value is in range
14362 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
14363 (match_limit): Don't assume that a fixnum can fit in 'int'.
14364
6511acf2 14365 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
14366 exceed INT_MAX.
14367
6511acf2 14368 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
14369 (Fvertical_motion): Don't wrap around LINES values that don't fit
14370 in 'int'. Instead, treat them as extreme values. This is good
14371 enough for windows, which can't have more than INT_MAX lines anyway.
14372
fcb901a7
LMI
143732011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14374
0f2f6b6d
LMI
14375 * Require libxml/parser.h to avoid compilation warning.
14376
fcb901a7
LMI
14377 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
14378
14379 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
14380 since this reportedly can destroy thread storage.
14381
6e20a0d4
CY
143822011-08-30 Chong Yidong <cyd@stupidchicken.com>
14383
14384 * syntax.c (find_defun_start): Update all cache variables if
14385 exiting early (Bug#9401).
14386
148ae00e
EZ
143872011-08-30 Eli Zaretskii <eliz@gnu.org>
14388
f6cfbd8f
EZ
14389 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
14390
148ae00e
EZ
14391 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
14392 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
14393 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
14394
14395 * term.c (tty_append_glyph): New function.
14396 (produce_stretch_glyph): Static function and its prototype deleted.
14397
a66cfb1c
SM
14398 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
14399 Add prototypes.
148ae00e 14400
c4a07a4c
PE
144012011-08-29 Paul Eggert <eggert@cs.ucla.edu>
14402
14403 * image.c (parse_image_spec): Check for nonnegative, not for positive,
14404 when checking :margin (Bug#9390).
14405 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 14406 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
14407 so that the name doesn't mislead. All uses changed.
14408
6bc8cd65
JB
144092011-08-28 Johan Bockgård <bojohan@gnu.org>
14410
14411 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
14412 set_tty_hooks.
14413
dca4927e
EZ
144142011-08-27 Eli Zaretskii <eliz@gnu.org>
14415
14416 * xdisp.c (move_it_to): Don't bail out early when reaching
14417 position beyond to_charpos, if we are scanning backwards.
14418 (move_it_vertically_backward): When DY == 0, make sure we get to
14419 the first character in the line after the newline.
14420
f2cad773
PE
144212011-08-27 Paul Eggert <eggert@cs.ucla.edu>
14422
14423 * ccl.c: Improve and simplify overflow checking (Bug#9196).
14424 (ccl_driver): Do not generate an out-of-range pointer.
14425 (Fccl_execute_on_string): Remove unnecessary check for
14426 integer overflow, noted by Stefan Monnier in
14427 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
14428 Remove a FIXME that didn't need fixing.
14429 Simplify the newly-introduced buffer reallocation code.
14430
0cae2cdb
JB
144312011-08-27 Juanma Barranquero <lekktu@gmail.com>
14432
14433 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
14434
5fc295a4 144352011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 14436
70c60eb2 14437 Integer and memory overflow issues (Bug#9196).
726e0ab1 14438
d31850da
PE
14439 * doc.c (get_doc_string): Rework so that
14440 get_doc_string_buffer_size is the actual buffer size, rather than
14441 being 1 less than the actual buffer size; this makes xpalloc more
14442 convenient.
14443
a69fbedb
PE
14444 * image.c (x_allocate_bitmap_record, cache_image):
14445 * xselect.c (Fx_register_dnd_atom):
14446 Simplify previous changes by using xpalloc.
14447
fe5c5d37
PE
14448 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
14449 since either will do and ptrdiff_t is convenient with xpalloc.
14450
0065d054
PE
14451 * charset.c (charset_table_size)
14452 (struct charset_sort_data.priority): Now ptrdiff_t.
14453 (charset_compare): Don't overflow if priorities differ greatly.
14454 (Fsort_charsets): Don't assume list length fits in int.
14455 Check for size-calculation overflow when allocating sort data.
14456 (syms_of_charset): Allocate an initial charset table that is
14457 just under 64 KiB, to avoid problems with glibc malloc and mmap.
14458
14459 * cmds.c (internal_self_insert): Check for size-calculation overflow.
14460
14461 * composite.h (struct composition.glyph_len): Now int, not unsigned.
14462 The actual value is always <= INT_MAX, and leaving it unsigned made
14463 overflow checking harder.
14464
14465 * dispextern.h (struct glyph_matrix.rows_allocated)
14466 (struct face_cache.size): Now ptrdiff_t, for convenience in use
14467 with xpalloc. The values are still always <= INT_MAX.
14468
14469 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
14470
14471 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
14472 (SAFE_NALLOCA): New macro.
14473
14474 * region-cache.c (struct boundary.pos, find_cache_boundary)
14475 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
14476 (set_cache_region, invalidate_region_cache)
14477 (revalidate_region_cache, know_region_cache, region_cache_forward)
14478 (region_cache_backward, pp_cache):
14479 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
14480 so that ptrdiff_t * can be passed to xpalloc.
14481 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
14482 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
14483 (pp_cache): Don't assume cache_len fits in int.
14484 * region-cache.h: Adjust extern decls to match.
14485
14486 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
14487 EMACS_INT, since either will do, for xpalloc.
14488
14489 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
14490 (xnmalloc, xnrealloc, xpalloc): New functions.
14491
726e0ab1
PE
14492 * bidi.c (bidi_shelve_header_size): New constant.
14493 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
14494 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
14495
51f30bc5 14496 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
14497 * buffer.c (overlays_at, overlays_in, record_overlay_string)
14498 (overlay_strings):
14499 Don't update size of array until after memory allocation succeeds,
14500 because xmalloc/xrealloc may not return.
0065d054
PE
14501 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
14502 now that we have proper integer overflow checking.
14503 (record_overlay_string, overlay_strings): Catch overflows when
14504 calculating size of overlay_str_buf.
726e0ab1 14505
0065d054
PE
14506 * callproc.c (Fcall_process): Check for size overflow when
14507 calculating size of args2.
14508 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
14509 Normally we prefer signed values, but sticking with ptrdiff_t would
14510 require adding more-complicated checks.
726e0ab1
PE
14511
14512 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
14513 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
14514 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 14515 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
14516
14517 * character.c (Fstring): Check for size-calculation overflow.
14518
14519 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
14520 unnecessary integer overflow. Check for size overflow.
14521 (encode_coding_object): Don't update size until xmalloc succeeds.
14522
14523 * composite.c (get_composition_id): Check for overflow in glyph
14524 length calculations.
14525
14526 Integer and memory overflow fixes for display code.
14527 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
14528 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
14529 (scrolling_window): Check for overflow in size calculations.
14530 (line_draw_cost, realloc_glyph_pool, add_row_entry):
14531 Don't assume glyph table len fits in int.
14532 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
14533 (row_table_size): Now ptrdiff_t, not int.
14534 (scrolling_window): Avoid overflow in size calculations.
14535 Don't update size until allocation succeeds.
14536 * fns.c (concat): Check for overflow in size calculations.
14537 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
14538 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
14539 (NEXT_ALMOST_PRIME_LIMIT): New constant.
14540
14541 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
14542 (get_doc_string): Check for size calculation overflow.
14543 Don't update size until allocation succeeds.
14544 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
14545 EMACS_INT, where ptrdiff_t will do.
14546 (Fsubstitute_command_keys): Check for string overflow.
14547
14548 * editfns.c (set_time_zone_rule): Don't assume environment length
14549 fits in int.
14550 (message_length): Now ptrdiff_t, not int.
14551 (Fmessage_box): Don't update size until allocation succeeds.
14552 Don't assume message length fits in int.
14553 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
14554
0065d054
PE
14555 * emacs.c (main): Do not reallocate argv, since there is a null at
14556 the end that can be overwritten, and this way there's no need to
14557 worry about size-calculation overflow.
14558 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
14559
14560 * eval.c (init_eval_once, grow_specpdl): Don't update size until
14561 alloc succeeds.
14562 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
14563
14564 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
14565 (x_set_scroll_bar_width, x_figure_window_size):
14566 Check for integer overflow.
14567 (x_set_alpha): Do not assume XINT fits in int.
14568
14569 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
14570 This is for the members text_lines, text_cols, total_lines, total_cols,
14571 where the system imposes an 'int' limit.
14572
14573 * fringe.c (Fdefine_fringe_bitmap):
14574 Don't update size until alloc works.
14575
14576 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
14577 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
14578
14579 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
14580 Check for size-calculation overflow.
14581 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
14582 do, as we prefer signed integers.
14583 (id_to_widget.max_size, id_to_widget.used)
14584 (xg_store_widget_in_map, xg_remove_widget_from_map)
14585 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
14586 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
14587 Use and return ptrdiff_t, not int.
14588 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
14589 * gtkutil.h: Change prototypes to match the above.
14590
14591 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
14592 are duplicate now that they've been promoted to lisp.h.
14593 (x_allocate_bitmap_record, x_alloc_image_color)
14594 (make_image_cache, cache_image, xpm_load):
14595 Don't update size until alloc is done.
14596 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
14597 (x_detect_edges):
3256efce 14598 Check for size calculation overflow.
726e0ab1
PE
14599 (ct_colors_allocated_max): New constant.
14600 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
14601 overflow.
3256efce 14602
726e0ab1
PE
14603 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
14604 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
14605 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
14606 Use ptrdiff_t, not int, to count maps.
14607 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
14608 calculations. Don't update size until allocation succeeds.
14609 Redo calculations to avoid overflow.
726e0ab1
PE
14610 * keyboard.h: Change prototypes to match the above.
14611
14612 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
14613 to count maps.
14614 (current_minor_maps): Check for size calculation overflow.
14615 * keymap.h: Change prototypes to match the above.
14616
14617 * lread.c (read1, init_obarray): Don't update size until alloc done.
14618
14619 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
14620 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
14621
726e0ab1
PE
14622 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
14623 Now ptrdiff_t, not int.
14624 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
14625 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
14626
14627 * process.c (Fnetwork_interface_list): Check for overflow
14628 in size calculation.
14629
14630 * region-cache.c (move_cache_gap): Check for size calculation overflow.
14631
14632 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
14633 overflow. Don't bother calling xmalloc when xrealloc will do.
14634
14635 * search.c (Freplace_match): Check for size calculation overflow.
14636 (Fset_match_data): Don't assume list lengths fit in 'int'.
14637
14638 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
14639 for command line length. Do not attempt to address one before the
14640 beginning of an array, as that's not portable.
14641
14642 * term.c (max_frame_lines): Remove; unused.
14643 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
14644 not int.
14645 (encode_terminal_code, calculate_costs): Check for size
14646 calculation overflow.
14647 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
14648 table lengths and related sizes. Don't update size until alloc
14649 done. Redo calculations to avoid overflow.
14650 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
14651
14652 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
14653 subtracting pointers.
14654 (gobble_line): Check for overflow more carefully. Don't update size
14655 until alloc done.
14656
14657 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
14658 Don't update size until alloc done.
14659 Redo size calculations to avoid overflow.
14660 Check for size calculation overflow.
0065d054 14661 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
14662
14663 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
14664 Use ptrdiff_t, not int, for sizes.
14665 (store_mode_line_noprop_char): Don't update size until alloc done.
14666
0065d054
PE
14667 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
14668 Use ptrdiff_t, not int, for sizes.
14669 (Finternal_make_lisp_face, cache_face):
14670 Check for size calculation overflow.
14671 (cache_face): Treat size calculation overflows as if they were
14672 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
14673
14674 * xfns.c (x_encode_text, x_set_name_internal)
14675 (Fx_change_window_property): Use ptrdiff_t, not int, to count
14676 sizes, since they can exceed INT_MAX in size. Check for size
14677 calculation overflow.
14678
0065d054
PE
14679 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
14680 (xg_select): Check for size calculation overflow.
726e0ab1
PE
14681 Don't update size until alloc done.
14682
0065d054 14683 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 14684 as sprintf is limited to int lengths.
1d526e2f 14685
252c5ee1
PE
14686 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
14687 (X_LONG_MIN): New macros.
864d7ce7
PE
14688 Use them to make the following changes clearer.
14689 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
14690 This change doesn't affect the value now, but it may help remind
14691 future maintainers not to raise the value too much later.
14692 (SELECTION_QUANTUM): Remove, replacing with ...
14693 (selection_quantum): ... new function, which avoids overflow.
14694 All uses changed.
14695 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
14696 assumption that selection length fits in 'int'.
14697 (x_reply_selection_request, x_handle_selection_request)
14698 (x_get_window_property, receive_incremental_selection)
14699 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
14700 (lisp_data_to_selection_data, clean_local_selection_data):
14701 Use ptrdiff_t, not int, to record length of selection.
14702 (x_reply_selection_request, x_get_window_property)
14703 (receive_incremental_selection, x_property_data_to_lisp):
14704 Redo calculations to avoid overflow.
14705 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 14706 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
14707 something.
14708 (x_get_window_property, receive_incremental_selection)
14709 (lisp_data_to_selection_data, x_property_data_to_lisp):
14710 Check for size-calculation overflow.
14711 (x_get_window_property, receive_incremental_selection)
14712 (lisp_data_to_selection_data, Fx_register_dnd_atom):
14713 Don't store size until memory allocation succeeds.
14714 (x_get_window_property): Plug memory leak on memory exhaustion.
14715 Don't double-block input; malloc is safe here. Don't assume 2**34
14716 - 4 fits in unsigned long. Add an xassert to check
14717 XGetWindowProperty overflow. Be more careful about overflow
14718 calculations, and distinguish size from memory overflow better.
14719 (receive_incremental_selection): When tracing, don't assume
14720 unsigned int is less than INT_MAX.
14721 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
14722 harmful) conversions of unsigned short to int.
14723 (lisp_data_to_selection_data): Don't assume that integers
14724 in the range -65535 through -1 fit in an X unsigned short.
14725 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
14726 result parameters unless successful. Rely on cons_to_unsigned
14727 to report problems with elements; the old code wasn't right anyway.
14728 (x_check_property_data): Check for int overflow; we cannot use
14729 a wider type due to X limits.
14730 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
14731
726e0ab1 14732 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 14733
0065d054
PE
14734 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
14735 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
14736 (x_color_cells): Don't store size until memory allocation succeeds.
14737 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 14738 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
14739 (x_term_init): Don't assume length fits in int (sprintf is limited
14740 to int size).
bc18e09d 14741
ebfa62c0
PE
14742 Use ptrdiff_t for composition IDs.
14743 * character.c (lisp_string_width):
14744 * composite.c (composition_table_size, n_compositions)
14745 (get_composition_id, composition_gstring_from_id):
14746 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
14747 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
14748 * window.c (Frecenter):
14749 Use ptrdiff_t, not int, for composition IDs.
14750 * composite.c (get_composition_id): Check for integer overflow.
14751 * composite.h: Adjust prototypes to match the above changes.
14752
d3411f89
PE
14753 Use ptrdiff_t for hash table indexes.
14754 * category.c (hash_get_category_set):
14755 * ccl.c (ccl_driver):
14756 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
14757 * coding.c (coding_system_charset_list, detect_coding_system):
14758 * coding.h (struct coding_system.id):
14759 * composite.c (get_composition_id, gstring_lookup_cache):
14760 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
14761 * image.c (xpm_get_color_table_h):
14762 * lisp.h (hash_lookup, hash_put):
14763 * minibuf.c (Ftest_completion):
14764 Use ptrdiff_t for hash table indexes, not int (which is too
14765 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
14766 32-bit --with-wide-int hosts).
14767
e097a6fa
PE
14768 * charset.c (Fdefine_charset_internal): Check for integer overflow.
14769 Add a FIXME comment about memory leaks.
14770 (syms_of_charset): Don't assume xmalloc returns.
14771
5637687f
PE
14772 Don't assume that stated character widths fit in int.
14773 * character.c (Fchar_width, c_string_width, lisp_string_width):
14774 * character.h (CHAR_WIDTH):
14775 * indent.c (MULTIBYTE_BYTES_WIDTH):
14776 Use sanitize_char_width to avoid undefined and/or bad behavior
14777 with outlandish widths.
a66cfb1c 14778 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
14779 now that we have two such functions. All uses changed.
14780 (sanitize_char_width): New inline function.
14781
a2271ba2
PE
14782 Don't assume that tab-width fits in int.
14783 * character.h (sanitize_width): New inline function.
14784 (SANE_TAB_WIDTH): New macro.
14785 (ASCII_CHAR_WIDTH): Use it.
14786 * indent.c (sane_tab_width): Remove. All uses replaced by
14787 SANE_TAB_WIDTH (current_buffer).
14788 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
14789
18c52557
PE
14790 * fileio.c: Integer overflow issues with file modes.
14791 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
14792
caeeedc1
PE
14793 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
14794 Remove unreachable code.
14795 (read_hex, load_charset_map_from_file): Check for integer overflow.
14796
6df6ae42 14797 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
14798 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
14799 (x_send_scroll_bar_event): Likewise. Check that the size does not
14800 exceed limits imposed by XClientMessageEvent, as well as the usual
14801 ptrdiff_t and size_t limits.
14802
b13995db
PE
14803 * keyboard.c: Overflow, signedness and related fixes.
14804 (make_lispy_movement): Use same integer type in forward decl
14805 that is used in the definition.
14806 (read_key_sequence, keyremap_step):
14807 Change bufsize argument back to int, undoing my 2011-03-30 change.
14808 We prefer signed types, and int is wide enough here.
14809 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
14810 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
14811 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
14812 length, not size_t. Use ptrdiff_t for index, not int.
14813 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
14814 possibility of integer overflow.
14815
13464394
PE
14816 Overflow, signedness and related fixes for images.
14817
14818 * dispextern.h (struct it.stack[0].u.image.image_id)
14819 (struct_it.image_id, struct image.id, struct image_cache.size)
14820 (struct image_cache.used, struct image_cache.ref_count):
14821 * gtkutil.c (update_frame_tool_bar):
14822 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
14823 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
14824 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
14825 * nsmenu.m (update_frame_tool_bar):
14826 * xdisp.c (calc_pixel_width_or_height):
14827 * xfns.c (image_cache_refcount):
14828 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
14829 on typical 64-bit hosts.
14830
14831 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
14832 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
14833 Omit unnecessary casts to int.
14834 (parse_image_spec): Check that integers fall into 'int' range
14835 when the callers expect that.
14836 (image_ascent): Redo ascent calculation to avoid int overflow.
14837 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
14838 (lookup_image): Remove unnecessary tests.
14839 (xbm_image_p): Locals are now of int, not EMACS_INT,
14840 since parse_image_check makes sure they fit into int.
14841 (png_load, gif_load, svg_load_image):
14842 Prefer int to unsigned where either will do.
14843 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
14844 old tiff_error_handler and tiff_warning_handler.
14845 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
14846 stack buffer overflows. It uses only the features of vsnprintf
14847 that are common to both POSIX and native Microsoft.
14848 (tiff_error_handler, tiff_warning_handler): Use it.
14849 (tiff_load, gif_load, imagemagick_load_image):
14850 Don't assume :index value fits in 'int'.
14851 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
14852 (imagemagick_load_image): Check that crop parameters fit into
14853 the integer types that MagickCropImage accepts. Don't assume
14854 Vimagemagick_render_type has a nonnegative value. Don't assume
14855 size_t fits in 'long'.
14856 (gs_load): Use printmax_t to print the widest integers possible.
14857 Check for integer overflow when computing image height and width.
14858
c11821d4
EZ
148592011-08-26 Eli Zaretskii <eliz@gnu.org>
14860
14861 * xdisp.c (redisplay_window): Don't force window start if point
14862 will be invisible in the resulting window. (Bug#9324)
14863
0c95fcf7
EZ
148642011-08-25 Eli Zaretskii <eliz@gnu.org>
14865
14866 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
14867 the display spec is of the form `(space ...)'.
14868 (handle_display_spec): Return the value returned by
14869 handle_single_display_spec, not just 1 or zero.
14870 (handle_single_display_spec): If the display spec is of the form
14871 `(space ...)', and specifies display in the text area, return 2
14872 rather than 1.
fee65a97 14873 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
14874 accurately, and prefer exact match for point under bidi.
14875 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
14876
14877 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
14878 into disp_prop; all users changed.
14879
14880 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
14881 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
14882 for the text covered by the display property.
14883
e4ed06f1
CY
148842011-08-25 Chong Yidong <cyd@stupidchicken.com>
14885
14886 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
14887 Change return value to nil.
14888 (Frecord_buffer): Delete unused function.
14889
f67cdd7f
EZ
148902011-08-24 Eli Zaretskii <eliz@gnu.org>
14891
5980d4c6
EZ
14892 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
14893 buffers, return left-to-right.
8610fe8b
EZ
14894 (set_cursor_from_row): Consider candidate row a win if its glyph
14895 represents a newline and point is on that newline. Fixes cursor
14896 positioning on the newline at EOL of R2L text within L2R
14897 paragraph, and vice versa.
14898 (try_cursor_movement): Check continued rows, in addition to
14899 continuation rows. Fixes unwarranted scroll when point enters a
14900 continued line of R2L text within an L2R paragraph, or vice versa.
14901 (cursor_row_p): Consider the case of point being equal to
14902 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
14903 from the end of a short line to the beginning of a continued line
14904 of R2L text within L2R paragraph.
14905 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
14906 composed characters.
5980d4c6 14907
f67cdd7f
EZ
14908 * bidi.c (bidi_check_type): Use xassert.
14909 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
14910 members.
14911
bca633fb
EZ
149122011-08-23 Eli Zaretskii <eliz@gnu.org>
14913
14914 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
14915 a character.
14916
4a5885a7
CY
149172011-08-23 Chong Yidong <cyd@stupidchicken.com>
14918
14919 * nsfont.m (ns_otf_to_script): Fix typo.
14920
0902a04e
KH
149212011-08-22 Kenichi Handa <handa@m17n.org>
14922
14923 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
14924 extra slot even if the purpose is char-code-property-table.
14925
1a2e6670
EZ
149262011-08-23 Eli Zaretskii <eliz@gnu.org>
14927
8ddde651
EZ
14928 * xdisp.c (redisplay_window): When computing centering_position,
14929 account for the height of the header line. (Bug#8874)
14930
425cc014
EZ
14931 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
14932 instead of CHAR_TO_BYTE. Fixes a crash when a completion
14933 candidate is selected by the mouse, and that candidate has a
14934 composed character under the mouse.
14935
1a2e6670
EZ
14936 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
14937 coordinates reported by pos-visible-in-window-p for a composed
14938 character in column zero.
14939
8b76d6f8
SM
149402011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
14941
14942 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
14943
dac347dd
EZ
149442011-08-22 Eli Zaretskii <eliz@gnu.org>
14945
14946 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
14947 consider it a hit if to_charpos is anywhere in the range of the
14948 composed buffer positions.
14949
e013fb34
CY
149502011-08-22 Chong Yidong <cyd@stupidchicken.com>
14951
14952 * image.c (gif_load): Don't assume that each subimage has the same
14953 dimensions as the base image. Handle disposal method that is
14954 "undefined" by the gif spec (Bug#9335).
14955
bd1ba3e8
CY
149562011-08-20 Chong Yidong <cyd@stupidchicken.com>
14957
14958 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 14959 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 14960
54a1215b
EZ
149612011-08-19 Eli Zaretskii <eliz@gnu.org>
14962
823564e5
EZ
14963 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
14964 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
14965 from an Org mode buffer to a Speedbar frame.
14966
54a1215b
EZ
14967 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
14968 a composition, take its buffer position from IT->cmp_it.charpos.
14969 Fixes cursor positioning at the beginning of a line that begins
14970 with a composed character.
14971
9778ebcc
EZ
149722011-08-18 Eli Zaretskii <eliz@gnu.org>
14973
0be6ee06
EZ
14974 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
14975 character bidirectional type, use STRONG_L instead. Fixes crashes
14976 in a buffer produced by `describe-categories'.
14977
9778ebcc
EZ
14978 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
14979 members before the level stack, so they would be saved and
14980 restored when copying iterator state. Fixes incorrect reordering
14981 around TABs covered by display properties.
14982
156bffbe
AS
149832011-08-18 Andreas Schwab <schwab@linux-m68k.org>
14984
6b02f655 14985 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 14986
72ad093b
CY
149872011-08-17 Chong Yidong <cyd@stupidchicken.com>
14988
14989 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
14990 (internal_condition_case_2, internal_condition_case_n):
14991 Remove unnecessary aborts (Bug#9081).
72ad093b 14992
35774242
EZ
149932011-08-17 Eli Zaretskii <eliz@gnu.org>
14994
14995 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
14996 has no `load' handler, try opening the file locally. (Bug#9311)
14997
db76dd85
KB
149982011-08-16 Ken Brown <kbrown@cornell.edu>
14999
15000 * gmalloc.c: Expand comment.
15001
b215eee5
EZ
150022011-08-16 Eli Zaretskii <eliz@gnu.org>
15003
15004 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
15005 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
15006
a4579d33
KB
150072011-08-16 Ken Brown <kbrown@cornell.edu>
15008
15009 Fix memory allocation problems in Cygwin build (Bug#9273).
15010
15011 * unexcw.c ( __malloc_initialized): Declare external variable.
15012 (fixup_executable): Force the dumped emacs to reinitialize malloc.
15013
8b76d6f8
SM
15014 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
15015 New variables.
a4579d33
KB
15016 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
15017 dumped emacs.
15018 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
15019 in the static heap.
15020 [CYGWIN] (special_realloc): New function.
15021 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
15022 requests to realloc storage in the static heap.
15023
3ebec551
PE
150242011-08-15 Paul Eggert <eggert@cs.ucla.edu>
15025
15026 * bidi.c (bidi_initialize): Remove unused local.
15027
9fd8be00
EZ
150282011-08-15 Eli Zaretskii <eliz@gnu.org>
15029
6b02f655
SM
15030 * bidimirror.h:
15031 * biditype.h: Remove file.
15032 * makefile.w32-in ($(BLD)/bidi.$(O)):
15033 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
15034
15035 * dispextern.h: Fix a typo in the comment to bidi_type_t.
15036
15037 * chartab.c: Improve commentary for the uniprop_table API.
15038
32413314
EZ
15039 * bidi.c (bidi_paragraph_init): Support zero value of
15040 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
15041 (bidi_initialize): Use uniprop_table instead of including
15042 biditype.h and bidimirror.h.
32413314 15043
9fd8be00
EZ
15044 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
15045 coordinates of the iterator when restoring from ppos_it.
15046 (Bug#9296)
15047
5cf2b69b
KH
150482011-08-14 Kenichi Handa <handa@m17n.org>
15049
15050 * process.c (create_process): Call setup_process_coding_systems
72ad093b 15051 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 15052
daf17d00
EZ
150532011-08-14 Eli Zaretskii <eliz@gnu.org>
15054
15055 * xdisp.c (move_it_in_display_line_to): Don't invoke
15056 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
15057 ppos_it. Fixes vertical cursor motion when line beginning is
15058 covered by an image. (Bug#9296)
15059
08e3161a
JD
150602011-08-14 Jan Djärv <jan.h.d@swipnet.se>
15061
15062 * nsterm.h (ns_run_ascript): Declare.
15063 (NSAPP_DATA2_RUNASSCRIPT): Define.
15064
15065 * nsfns.m (as_script, as_result, as_status): New static variables.
15066 (ns_run_ascript): New function.
5e617bc2 15067 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
15068 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
15069 the event loop. Get status from as_status (Bug#7276).
15070
15071 * nsterm.m (sendEvent): If event is NSApplicationDefined and
15072 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
15073 the event loop (Bug#7276).
15074
a3720aa2
AS
150752011-08-14 Andreas Schwab <schwab@linux-m68k.org>
15076
15077 * gnutls.c (QCgnutls_bootprop_priority)
15078 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
15079 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
15080 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
15081 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
15082 (QCgnutls_bootprop_verify_hostname_error)
15083 (QCgnutls_bootprop_callbacks_verify): Rename from
15084 Qgnutls_bootprop_..., all uses changed.
15085
15086 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
15087 uses changed.
15088
0a0d27fb
PE
150892011-08-14 Paul Eggert <eggert@cs.ucla.edu>
15090
19d5c50c
PE
15091 * xfaces.c (Qframe_set_background_mode): Now static.
15092 * dispextern.h (Qframe_set_background_mode): Remove decl.
15093
0a0d27fb
PE
15094 * process.c (Fnetwork_interface_info): Declare local only if needed.
15095
377538cb
JD
150962011-08-13 Jan Djärv <jan.h.d@swipnet.se>
15097
15098 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
15099 (Fnetwork_interface_list): Allocate in increments of bytes instead
15100 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
15101 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
15102 sockaddr.
15103 (struct ifflag_def): notrailers is smart on OSX.
15104 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
15105 Get hardware address with getifaddrs if available.
15106
08fff70c
EZ
151072011-08-12 Eli Zaretskii <eliz@gnu.org>
15108
15109 * xdisp.c (iterate_out_of_display_property): xassert that
15110 IT->position is set to within IT->object's boundaries. Break from
15111 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
15112 when IT->position is set up wrongly due to some bug.
15113 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
15114 (push_display_prop): Allow GET_FROM_STRING as IT->method on
15115 entry. Force push_it to save on the stack the current
15116 buffer/string position, to be restored by pop_it. Fix flags in
15117 the iterator structure wrt the object coming from a display
15118 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
15119 properties. (Bug#9284)
15120
7be1c708 151212011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 15122
7be1c708
CY
15123 * fontset.c (fontset_get_font_group): Add proper type checks.
15124 (Bug#9172)
aac0c6e3 15125
7be1c708 151262011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 15127
7be1c708
CY
15128 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
15129 and LC_VERSION_MIN_MACOSX.
15130 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
15131 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 15132
97bb72a6
EZ
151332011-08-08 Eli Zaretskii <eliz@gnu.org>
15134
15135 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
15136 no-display-properties-and-no-overlays under bidi display.
15137 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 15138 properties and overlays.
97bb72a6 15139
d5617611
CY
151402011-08-08 Chong Yidong <cyd@stupidchicken.com>
15141
37e11a63
CY
15142 * editfns.c (Fset_time_zone_rule): Document relationship with the
15143 setenv function.
15144
d5617611
CY
15145 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
15146 the font entity extracted from the cache (Bug#8109).
15147
58872834
CY
151482011-08-07 Chong Yidong <cyd@stupidchicken.com>
15149
15150 * composite.c (autocmp_chars): Don't reset point. That is done by
15151 restore_point_unwind (Bug#5984).
15152
75bfc667
JL
151532011-08-07 Juri Linkov <juri@jurta.org>
15154
15155 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
15156 to show the arg `TIME' instead of `TIMEVAL'.
15157
d1410150
EZ
151582011-08-06 Eli Zaretskii <eliz@gnu.org>
15159
15160 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
15161 display property strides EOL and includes a newline, as in
15162 longlines-mode. (Bug#9254)
75b771e4
EZ
15163 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
15164 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
15165
15166 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
15167 is non-zero, even if the data buffer is NULL. Fixes a crash in
15168 vertical-motion with longlines-mode. (Bug#9254)
15169
35928349
EZ
151702011-08-05 Eli Zaretskii <eliz@gnu.org>
15171
ec7cc85b
EZ
15172 * bidi.c <bidi_cache_total_alloc>: Now static.
15173 (bidi_initialize): Initialize bidi_cache_total_alloc.
15174
8b76d6f8 15175 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
15176 cache. (Bug#9221)
15177
15178 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
15179 amount allocated this far in `bidi_cache_total_alloc'.
15180 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
15181 non-zero, only free the data buffer without restoring the cache
15182 contents. All callers changed.
15183
15184 * dispextern.h (bidi_unshelve_cache): Update prototype.
15185
15186 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
15187 (move_it_in_display_line, move_it_to)
15188 (move_it_vertically_backward, move_it_by_lines): Replace the call
15189 to xfree to an equivalent call to bidi_unshelve_cache.
15190 (move_it_in_display_line_to): Fix logic of returning
412b6358 15191 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 15192
e2e2423b
EZ
151932011-08-05 Eli Zaretskii <eliz@gnu.org>
15194
15195 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
15196 came from a string character with a `cursor' property. (Bug#9229)
15197
ae9e757a
JD
151982011-08-04 Jan Djärv <jan.h.d@swipnet.se>
15199
15200 * Makefile.in (LIB_PTHREAD): New variable.
15201 (LIBES): Add LIB_PTHREAD (Bug#9216).
15202
15203 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
15204 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
15205
213bd7f2
AS
152062011-08-04 Andreas Schwab <schwab@linux-m68k.org>
15207
6b02f655 15208 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 15209
99aaf75f
JD
152102011-08-04 Jan Djärv <jan.h.d@swipnet.se>
15211
15212 * xterm.c (x_find_topmost_parent): New function.
15213 (x_set_frame_alpha): Find topmost parent window with
15214 x_find_topmost_parent and set the property there also (bug#9181).
15215 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
15216
c74e9d86
PE
152172011-08-04 Paul Eggert <eggert@cs.ucla.edu>
15218
15219 * callproc.c (Fcall_process): Avoid vfork clobbering
15220 the local vars buffer, coding_systems, current_dir.
15221
640c8776
SM
152222011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
15223
15224 * keymap.c (Fmake_composed_keymap): Move to subr.el.
15225
f26d0e4c
PE
152262011-08-03 Paul Eggert <eggert@cs.ucla.edu>
15227
8a10d76c
PE
15228 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
15229 so that it is not optimized away.
15230
f26d0e4c
PE
15231 * xdisp.c (compute_display_string_pos): Remove unused local.
15232
55439c61
EZ
152332011-08-02 Eli Zaretskii <eliz@gnu.org>
15234
15235 Fix slow cursor motion and scrolling in large buffers with
15236 selective display, like Org Mode buffers. (Bug#9218)
15237
15238 * dispextern.h (struct bidi_it): New member disp_prop_p.
15239
15240 * xdisp.c: Remove one-slot cache of display string positions.
15241 (compute_display_string_pos): Accept an additional argument
5e617bc2 15242 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
15243 for a display string or property. If found, set DISP_PROP_P
15244 non-zero.
15245
15246 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
15247 DISP_PROP_P, and pass it to compute_display_string_pos.
15248 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
15249 non-zero. All callers of bidi_fetch_char changed.
15250
fb33fa43
SM
152512011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
15252
15253 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
15254
b099e063
DM
152552010-12-03 Don March <don@ohspite.net>
15256
15257 * keymap.c (Fdefine_key): Fix non-prefix key error message when
15258 last character M-[char] is translated to ESC [char] (bug#7541).
15259
5cc7f7af
KH
152602011-08-02 Kenichi Handa <handa@m17n.org>
15261
d0fffa3f 15262 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
15263
15264 * chartab.c (uniprop_table): Make it non-static.
15265
525d5e6e
EZ
152662011-08-01 Eli Zaretskii <eliz@gnu.org>
15267
15268 * xdisp.c (forward_to_next_line_start): Accept additional argument
15269 BIDI_IT_PREV, and store into it the state of the bidi iterator had
15270 on the newline.
15271 (reseat_at_next_visible_line_start): Use the bidi iterator state
15272 returned by forward_to_next_line_start to restore the state of
15273 it->bidi_it after backing up to previous newline. (Bug#9212)
15274
31011111
AS
152752011-07-30 Andreas Schwab <schwab@linux-m68k.org>
15276
15277 * regex.c (re_comp): Protoize.
15278 (re_exec): Fix return type.
15279 (regexec): Fix type of `ret'. (Bug#9203)
15280
476371c4
PE
152812011-07-28 Paul Eggert <eggert@cs.ucla.edu>
15282
e5d76069
PE
15283 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
15284 This is needed if max-image-size is a floating-point number.
15285
9a79b20c
AS
152862011-07-28 Andreas Schwab <schwab@linux-m68k.org>
15287
15288 * print.c (print_object): Print empty symbol as ##.
15289
15290 * lread.c (read1): Read ## as empty symbol.
15291
d8c2fa78
AA
152922011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
15293
15294 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
15295 setting frame foreground color (Bug#9175).
15296 (x_set_background_color): Likewise.
15297
ffe57a7a
AA
15298 * nsmenu.m (-setText): Size tooltip dimensions precisely to
15299 contents (Bug#9176).
15300 (EmacsTooltip -init): Remove bezels and add shadows to
15301 tooltip windows.
15302
bf3492a5
AA
15303 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
15304 or scroll bar (Bug#8470).
15305
d55e9c53
AA
15306 * nsfont.m (nsfont_open): Remove assignment to voffset and
15307 unnecessary vars hshink, expand, hd, full_height, min_height.
15308 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
15309
15310 * nsterm.h (nsfont_info): Remove voffset field.
15311
d8c2fa78 153122011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
15313
15314 Implement strike-through and overline on NextStep (Bug#8863).
15315
15316 * nsfont.m (nsfont_open): Use underline position provided by font,
15317 instead of hard-coded value of 2.
15318 (nsfont_draw): Call ns_draw_text_decoration instead.
15319
15320 * nsterm.h: Add declaration for ns_draw_text_decoration.
15321
15322 * nsterm.m (ns_draw_text_decoration): New function for drawing
15323 underline, overline, and strike-through.
15324 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
15325 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 15326 accommodate underlining, etc.
4843aac3 15327
4cc60b9b
EZ
153282011-07-28 Eli Zaretskii <eliz@gnu.org>
15329
bc7ece87
EZ
15330 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
15331 default.
4cc60b9b 15332
476371c4
PE
153332011-07-28 Paul Eggert <eggert@cs.ucla.edu>
15334
66606eea
PE
15335 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
15336 Without this fix, if a signal arrives just after memory fills up,
15337 'malloc' might be invoked reentrantly.
15338
476371c4
PE
15339 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
15340 In other words, assume that every image size is allowed, on non-X
15341 hosts. This assumption is probably wrong, but it lets Emacs compile.
15342
f3fcc40d
AS
153432011-07-28 Andreas Schwab <schwab@linux-m68k.org>
15344
15345 * regex.c (re_iswctype): Convert return values to boolean.
15346
350c992f
EZ
153472011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
15348
15349 * xdisp.c (compute_display_string_pos): Don't use cached display
15350 string position if the buffer had its restriction changed.
15351 (Bug#9184)
15352
5266b4bb
PE
153532011-07-28 Paul Eggert <eggert@cs.ucla.edu>
15354
15355 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15356
2573a837 153572011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 15358
41f55ccd 15359 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 15360
39e378da
PE
15361 * bidi.c: Integer size and overflow fixes.
15362 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
15363 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
15364 (bidi_cache_find_level_change, bidi_cache_ensure_space)
15365 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
15366 (bidi_find_other_level_edge):
15367 Use ptrdiff_t instead of EMACS_INT where either will do.
15368 This works better on 32-bit hosts configured --with-wide-int.
15369 (bidi_cache_ensure_space): Check for size-calculation overflow.
15370 Use % rather than repeated addition, for better worst-case speed.
15371 Don't set bidi_cache_size until after xrealloc returns, because it
15372 might not return.
15373 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
15374 (bidi_cache_ensure_space): Also check that the bidi cache size
15375 does not exceed that of the largest Lisp string or buffer. See Eli
15376 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 15377
5e927815
PE
15378 * alloc.c (__malloc_size_t): Remove.
15379 All uses replaced by size_t. See Andreas Schwab's note
15380 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
15381
ca4aa935
PE
15382 * image.c: Improve checking for integer overflow.
15383 (check_image_size): Assume that f is nonnull, since
15384 it is always nonnull in practice. This is one less thing to
15385 worry about when checking for integer overflow later.
15386 (x_check_image_size): New function, which checks for integer
15387 overflow issues inside X.
15388 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
15389 This removes the need for a memory_full check.
15390 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
15391 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
15392 (xbm_read_bitmap_data): Change locals back to 'int', since
15393 their values must fit in 'int'.
15394 (xpm_load_image, png_load, tiff_load):
15395 Invoke x_create_x_image_and_pixmap earlier,
15396 to avoid much needless work if the image is too large.
15397 (tiff_load): Treat overly large images as if
15398 x_create_x_image_and_pixmap failed, not as malloc failures.
15399 (gs_load): Use x_check_image_size.
15400
5f8f9cc2
PE
15401 * gtkutil.c: Omit integer casts.
15402 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
15403 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
15404
5adf60bc
PE
15405 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
15406
c8907a93
PE
15407 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
15408 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
15409 would wrongly return t on a 64-bit host.
15410
e3c25c68
PE
15411 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
15412 The plain *_OVERFLOW macros run afoul of GCC bug 49705
15413 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
15414 and therefore cause GCC to emit a bogus diagnostic in some cases.
15415
3f791afe
PE
15416 * image.c: Integer signedness and overflow and related fixes.
15417 This is not an exhaustive set of fixes, but it's time to
15418 record what I've got.
15419 (lookup_pixel_color, check_image_size): Remove redundant decls.
15420 (check_image_size): Don't assume that arbitrary EMACS_INT values
15421 fit in 'int', or that arbitrary 'double' values fit in 'int'.
15422 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
15423 (tiff_load, imagemagick_load_image):
15424 Check for overflow in size calculations.
15425 (x_create_x_image_and_pixmap): Remove unnecessary test for
15426 xmalloc returning NULL; that can't happen.
15427 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
15428 (xpm_color_bucket): Use better integer hashing function.
15429 (xpm_cache_color): Don't possibly over-allocate memory.
15430 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
15431 (gif_memory_source):
15432 Use ptrdiff_t, not int or size_t, to record sizes.
15433 (png_load): Don't assume values greater than 2**31 fit in 'int'.
15434 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
15435 either works, as we prefer signed integers.
15436 (tiff_read_from_memory, tiff_write_from_memory):
15437 Return tsize_t, not size_t, since that's what the TIFF API wants.
15438 (tiff_read_from_memory): Don't fail simply because the read would
15439 go past EOF; instead, return a short read.
15440 (tiff_load): Omit no-longer-needed casts.
15441 (Fimagemagick_types): Don't assume size fits into 'int'.
15442
3cc5a532
PE
15443 Improve hashing quality when configured --with-wide-int.
15444 * fns.c (hash_string): New function, taken from sxhash_string.
15445 Do not discard information about ASCII character case; this
15446 discarding is no longer needed.
15447 (sxhash-string): Use it. Change sig to match it. Caller changed.
15448 * lisp.h: Declare it.
15449 * lread.c (hash_string): Remove, since we now use fns.c's version.
15450 The fns.c version returns a wider integer if --with-wide-int is
15451 specified, so this should help the quality of the hashing a bit.
15452
b312a492
PE
15453 * emacs.c: Integer overflow minor fix.
15454 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
15455 Define only if GNU_LINUX.
15456 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
15457
dfd153ae
PE
15458 * dispnew.c: Integer signedness and overflow fixes.
15459 Remove unnecessary forward decls, that were a maintenance hassle.
15460 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
15461 All uses changed.
15462 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
15463 (scrolling_window): Use ptrdiff_t, not int, for byte count.
15464 (prepare_desired_row, line_draw_cost):
15465 Use int, not unsigned, where either works.
15466 (save_current_matrix, restore_current_matrix):
15467 Use ptrdiff_t, not size_t, where either works.
15468 (init_display): Check for overflow more accurately, and without
15469 relying on undefined behavior.
15470
a81d11a3
PE
15471 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
15472 Remove, replacing with the new symbols in lisp.h. All uses changed.
15473 * fileio.c (make_temp_name):
15474 * filelock.c (lock_file_1, lock_file):
15475 * xdisp.c (message_dolog):
15476 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
15477 Use pMd etc. instead.
15478 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
15479 replacing the pWIDE etc. symbols removed from editfns.c.
15480
3300e6fd
PE
15481 * keyboard.h (num_input_events): Now uintmax_t.
15482 This is (very slightly) less likely to mess up due to wraparound.
15483 All uses changed.
15484
fd05c7e9
PE
15485 * buffer.c: Integer signedness fixes.
15486 (alloc_buffer_text, enlarge_buffer_text):
15487 Use ptrdiff_t rather than size_t when either will do, as we prefer
15488 signed integers.
15489
903fe15d
PE
15490 * alloc.c: Integer signedness and overflow fixes.
15491 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
15492 (__malloc_size_t): Default to size_t, not to int.
15493 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
15494 (Fgarbage_collect, mark_object_loop_halt, mark_object):
15495 Prefer ptrdiff_t to size_t when either would do, as we prefer
15496 signed integers.
15497 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
15498 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
15499 Now const. Initialize with values that are in range even if char
15500 is signed.
15501 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
15502 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
15503 These functions do the right thing with sizes > 2**32.
15504 (check_depth): Now ptrdiff_t, not int.
15505 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
15506 Adjust to new way of storing sizes. Check for size overflow bugs
15507 in rest of code.
15508 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
15509 slightly wrong anyway, as it missed one instance of
15510 XMALLOC_OVERRUN_CHECK_OVERHEAD.
15511 (refill_memory_reserve): Omit needless cast to size_t.
15512 (mark_object_loop_halt): Mark as externally visible.
15513
ac82cc6a
PE
15514 * xselect.c: Integer signedness and overflow fixes.
15515 (Fx_register_dnd_atom, x_handle_dnd_message):
15516 Use ptrdiff_t, not size_t, since we prefer signed.
15517 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
15518 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
15519 x_dnd_atoms_size and x_dnd_atoms_length.
15520
c2d1e36d
PE
15521 * doprnt.c: Prefer signed to unsigned when either works.
15522 * eval.c (verror):
15523 * doprnt.c (doprnt):
15524 * lisp.h (doprnt):
15525 * xdisp.c (vmessage):
15526 Use ptrdiff_t, not size_t, when using or implementing doprnt,
15527 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
15528 prefer signed arithmetic to avoid comparison confusion.
15529 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
15530 but is a bit tricky.
15531
0e926e56
PE
15532 Assume freestanding C89 headers, string.h, stdlib.h.
15533 * data.c, doprnt.c, floatfns.c, print.c:
15534 Include float.h unconditionally.
15535 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
15536 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
15537 * regex.c: Likewise for stddef.h, string.h.
15538 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
15539 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
15540 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
15541 (STDC_HEADERS): Remove obsolete defines.
15542 * sysdep.c: Include limits.h unconditionally.
15543
9cfdb3ec
PE
15544 Assume support for memcmp, memcpy, memmove, memset.
15545 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
15546 * regex.c (memcmp, memcpy):
15547 Remove; we assume C89 now.
15548
15549 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
15550 (__malloc_safe_bcopy): Remove; no longer needed.
15551
cf950e6b 15552 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
15553 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
15554 well either way, and we prefer signed to unsigned.
15555
dbf38e02
LMI
155562011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
15557
15558 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
15559 closes the connection while we're reading (bug#9182).
15560
d6f0886c 155612011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 15562
d6f0886c
JD
15563 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
15564 are specified (Bug#9168).
24e0f6b1 15565
2eb1f9e6
PE
155662011-07-25 Paul Eggert <eggert@cs.ucla.edu>
15567
15568 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
15569 Found by GCC static checking and --with-wide-int on a 32-bit host.
15570
22381272 155712011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
15572
15573 * xdisp.c (compute_display_string_pos): Fix logic of caching
15574 previous display string position. Initialize cached_prev_pos to
15575 -1. Fixes slow-down at the beginning of a buffer.
15576
f25e39b4
EZ
155772011-07-24 Eli Zaretskii <eliz@gnu.org>
15578
15579 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
15580 for attrs[LFACE_FONTSET_INDEX].
15581
04c4b52e
PE
155822011-07-23 Paul Eggert <eggert@cs.ucla.edu>
15583
15584 * xml.c (parse_region): Remove unused local
15585 that was recently introduced.
15586
c1734fbd
EZ
155872011-07-23 Eli Zaretskii <eliz@gnu.org>
15588
be18c5a5
EZ
15589 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
15590 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
15591
c1734fbd
EZ
15592 * xdisp.c (move_it_in_display_line_to): Record the best matching
15593 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
15594 exit if none of the characters scanned was an exact match.
15595 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
15596 when exact match is impossible due to invisible text, and the
15597 lines are truncated.
15598
a258d627
JD
155992011-07-23 Jan Djärv <jan.h.d@swipnet.se>
15600
15601 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
15602 for OSX >= 10.7.
15603
b6d5a689
EZ
156042011-07-22 Eli Zaretskii <eliz@gnu.org>
15605
0f74f785
EZ
15606 Fix a significant slow-down of cursor motion with C-n, C-p,
15607 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
15608 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 15609 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
15610 (next_element_from_buffer): Call compute_stop_pos_backwards to
15611 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
15612 base_level_stop.
15613 (reseat): Don't look for prev_stop, as that could mean a very long
15614 run.
15615 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
15616 <cached_disp_overlay_modiff>: Cache for last found display string
15617 position.
551918c1 15618 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
15619 about the same buffer in the same area of character positions, and
15620 the buffer wasn't changed since the time the display string
15621 position was cached.
551918c1 15622
b2d0c91a
EZ
156232011-07-22 Eli Zaretskii <eliz@gnu.org>
15624
15625 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
15626 is an integer, which is important for empty lines. (Bug#9149)
15627
043604ee
CY
156282011-07-22 Chong Yidong <cyd@stupidchicken.com>
15629
15630 * frame.c (Fmodify_frame_parameters): In tty case, update the
15631 default face if necessary (Bug#4238).
15632
da4adb04
CY
156332011-07-21 Chong Yidong <cyd@stupidchicken.com>
15634
15635 * editfns.c (Fstring_to_char): No need to explain what a character
15636 is in the docstring (Bug#6576).
15637
9abd0532
LMI
156382011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
15639
15640 * xml.c (parse_region): Make sure we always return a tree.
15641
36881d16
HK
156422011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
15643
15644 * xml.c (parse_region): If a document contains only comments,
15645 return that, too.
15646
1e98674d
LMI
156472011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
15648
15649 * xml.c (make_dom): Return comments, too.
15650
590bd467
PE
156512011-07-19 Paul Eggert <eggert@cs.ucla.edu>
15652
15653 Port to OpenBSD.
15654 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
15655 and the surrounding thread.
15656 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
15657 rather than fgets, and retry after EINTR. Otherwise, 'emacs
15658 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
15659 timer goes off.
15660 * s/openbsd.h (BROKEN_SIGIO): Define.
15661 * unexelf.c (unexec) [__OpenBSD__]:
15662 Don't update the .mdebug section of the Alpha COFF symbol table.
15663
f41628b2
LMI
156642011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
15665
15666 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
15667 (bug#8460).
15668
b59b67c5
PE
156692011-07-18 Paul Eggert <eggert@cs.ucla.edu>
15670
15e3a074
PE
15671 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
15672 This fixes some race conditions on the permissions of any newly
15673 created file.
15674
41bed37d
PE
15675 * alloc.c (valid_pointer_p): Use pipe, not open.
15676 This fixes some permissions issues when debugging.
15677
b59b67c5
PE
15678 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
15679 If fchown fails to set both uid and gid, try to set just gid,
15680 as that is sometimes allowed. Adjust the file's mode to eliminate
15681 setuid or setgid bits that are inappropriate if fchown fails.
15682
925a6be7
SM
156832011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
15684
15685 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
15686 to compare Lisp_Objects.
15687 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
15688 global_gnutls_log_level, don't mistake it for a Lisp_Object.
15689 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
15690
52968808
AS
156912011-07-17 Andreas Schwab <schwab@linux-m68k.org>
15692
0a6a104b
AS
15693 * lread.c (read_integer): Unread even EOF character.
15694 (read1): Likewise. Properly record start position of symbol.
15695
52968808
AS
15696 * lread.c (read1): Read `#:' as empty uninterned symbol if no
15697 symbol character follows.
15698
9e381cdd
PE
156992011-07-17 Paul Eggert <eggert@cs.ucla.edu>
15700
15701 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
15702 This works around a problem with the previous change to Fcopy_file.
15703 Recent glibc declares fchown with __attribute__((warn_unused_result)),
15704 and without this change, GCC might complain about discarding
15705 fchown's return value.
15706
b5641435
JB
157072011-07-16 Juanma Barranquero <lekktu@gmail.com>
15708
15709 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
15710
a8031457
PE
157112011-07-16 Paul Eggert <eggert@cs.ucla.edu>
15712
15713 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
15714
dd889327
LMI
157152011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
15716
750c33f7
LMI
15717 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
15718 it's used from the C level.
15719
dd889327
LMI
15720 * process.c: Use the same condition for POLL_FOR_INPUT in both
15721 keyboard.c and process.c (bug#1858).
15722
87e86684
LM
157232011-07-09 Lawrence Mitchell <wence@gmx.li>
15724
15725 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
15726 (Fgnutls_boot): Use it.
15727
64348f40
AS
157282011-07-15 Andreas Schwab <schwab@linux-m68k.org>
15729
15730 * doc.c (Fsubstitute_command_keys): Revert last change.
15731
1d698799
LMI
157322011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
15733
f863868c
LMI
15734 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
15735 quotes the next character, and doesn't affect other longer
15736 sequences (bug#8935).
15737
1d698799
LMI
15738 * lread.c (syms_of_lread): Clarify that is isn't only
15739 `eval-buffer' and `eval-defun' that's affected by
15740 `lexical-binding' (bug#8460).
15741
aa4b6df6
EZ
157422011-07-15 Eli Zaretskii <eliz@gnu.org>
15743
15744 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 15745 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 15746
5d856da6
PE
157472011-07-14 Paul Eggert <eggert@cs.ucla.edu>
15748
ad6042bb
PE
15749 Fix minor problems found by static checking.
15750 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
15751 (elsz): Now a signed constant, not a size_t var. We prefer signed
15752 types to unsigned, to avoid integer comparison confusion. Without
15753 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
15754 "cannot optimize loop, the loop counter may overflow", a symptom
15755 of the confusion.
f00bbb22 15756 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
15757 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
15758
6468f31c
LMI
157592011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
15760
49080b10
LMI
15761 * search.c (Fre_search_backward): Mention `case-fold-search' in
15762 all the re_search_* functions (bug#8138).
15763
6468f31c
LMI
15764 * keyboard.c (Fopen_dribble_file): Document when the file is
15765 closed (bug#8056).
15766
c965adc5
EZ
157672011-07-14 Eli Zaretskii <eliz@gnu.org>
15768
df9733bf
EZ
15769 * bidi.c (bidi_dump_cached_states): Fix format of displaying
15770 bidi_cache_idx.
15771
0bb23927
EZ
15772 Support bidi reordering of display and overlay strings.
15773 * xdisp.c (compute_display_string_pos)
15774 (compute_display_string_end): Accept additional argument STRING.
15775 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
15776 (reseat_to_string): Initialize bidi_it->string.s and
15777 bidi_it->string.schars.
15778 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
15779 NULL (avoids a crash in bidi_paragraph_init).
15780 Initialize itb.string.lstring.
0bb23927
EZ
15781 (init_iterator): Call bidi_init_it only of a valid
15782 buffer position was specified. Initialize paragraph_embedding to
15783 L2R.
15784 (reseat_to_string): Initialize the bidi iterator.
15785 (display_string): If we need to ignore text properties of
15786 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
15787 original value of -1 will not work with bidi.)
15788 (compute_display_string_pos): First arg is now struct
15789 `text_pos *'; all callers changed. Support display properties on
15790 Lisp strings.
15791 (compute_display_string_end): Support display properties on Lisp
15792 strings.
15793 (init_iterator, reseat_1, reseat_to_string): Initialize the
15794 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
15795 when iterating on a string not from display properties).
640c8776
SM
15796 (compute_display_string_pos, compute_display_string_end):
15797 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
15798 arrow keys.
15799 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
15800 base_level_stop; instead, set base_level_stop to BEGV.
15801 Fixes crashes in vertical-motion.
0bb23927
EZ
15802 (next_element_from_buffer): Improve commentary for when
15803 the iterator is before prev_stop.
15804 (init_iterator): Initialize bidi_p from the default value of
15805 bidi-display-reordering, not from buffer-local value. Use the
15806 buffer-local value only if initializing for buffer iteration.
15807 (handle_invisible_prop): Support invisible properties on strings
15808 that are being bidi-reordered.
15809 (set_iterator_to_next): Support bidi reordering of C strings and
15810 Lisp strings.
15811 (next_element_from_string): Support bidi reordering of Lisp
15812 strings.
15813 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
15814 (display_string): Support display of R2L glyph rows.
15815 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
15816 (init_iterator): Don't initialize it->bidi_p for strings
15817 here.
15818 (reseat_to_string): Initialize it->bidi_p for strings here.
15819 (next_element_from_string, next_element_from_c_string)
15820 (next_element_from_buffer): Add xassert's for correspondence
15821 between IT's object being iterated and it->bidi_it.string
15822 structure.
15823 (face_before_or_after_it_pos): Support bidi iteration.
15824 (next_element_from_c_string): Handle the case of the first string
15825 character that is not the first one in the visual order.
15826 (get_visually_first_element): New function, refactored from common
15827 parts of next_element_from_buffer, next_element_from_string, and
15828 next_element_from_c_string.
15829 (tool_bar_lines_needed, redisplay_tool_bar)
15830 (display_menu_bar): Force left-to-right direction. Add a FIXME
15831 comment for making that be controlled by a user option.
15832 (push_it, pop_it): Save and restore the state of the
15833 bidi iterator. Save and restore the bidi_p flag.
15834 (pop_it): Iterate out of display property for string iteration as
15835 well.
15836 (iterate_out_of_display_property): Support iteration over strings.
15837 (handle_single_display_spec): Set up it->bidi_it for iteration
15838 over a display string, and call bidi_init_it.
15839 (handle_single_display_spec, next_overlay_string)
15840 (get_overlay_strings_1, push_display_prop): Set up the bidi
15841 iterator for displaying display or overlay strings.
15842 (forward_to_next_line_start): Don't use the shortcut if
15843 bidi-iterating.
15844 (back_to_previous_visible_line_start): If handle_display_prop
15845 pushed the iterator stack, restore the internal state of the bidi
15846 iterator by calling bidi_pop_it same number of times.
15847 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
15848 and we are bidi-iterating, don't decrement the iterator position;
15849 instead, set the first_elt flag in the bidi iterator, to produce
15850 the same effect.
15851 (reseat_1): Remove redundant setting of string_from_display_prop_p.
15852 (push_display_prop): xassert that we are iterating a buffer.
15853 (push_it, pop_it): Save and restore paragraph_embedding member.
15854 (handle_single_display_spec, next_overlay_string)
15855 (get_overlay_strings_1, reseat_1, reseat_to_string)
15856 (push_display_prop): Set up the `unibyte' member of bidi_it.string
15857 correctly. Don't assume unibyte strings are not bidi-reordered.
15858 (compute_display_string_pos)
15859 (compute_display_string_end): Fix handling the case of C string.
15860 (push_it, pop_it): Save and restore from_disp_prop_p.
15861 (handle_single_display_spec, push_display_prop): Set the
15862 from_disp_prop_p flag.
15863 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
15864 (pop_it): Call iterate_out_of_display_property only if we are
15865 popping after iteration over a string that came from a display
15866 property. Fix a typo in popping stretch info. Add an assertion
15867 for verifying that the iterator position is in sync with the bidi
15868 iterator.
15869 (handle_single_display_spec, get_overlay_strings_1)
15870 (push_display_prop): Fix initialization of paragraph direction for
15871 string when that of the parent object is not yet determined.
15872 (reseat_1): Call bidi_init_it to resync the bidi
15873 iterator with IT's position. (Bug#7616)
15874 (find_row_edges): If ROW->start.pos gives position
15875 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
15876 (handle_stop, back_to_previous_visible_line_start, reseat_1):
15877 Reset the from_disp_prop_p flag.
15878 (SAVE_IT, RESTORE_IT): New macros.
15879 (pos_visible_p, face_before_or_after_it_pos)
15880 (back_to_previous_visible_line_start)
15881 (move_it_in_display_line_to, move_it_in_display_line)
15882 (move_it_to, move_it_vertically_backward, move_it_by_lines)
15883 (try_scrolling, redisplay_window, display_line): Use them when
15884 saving a temporary copy of the iterator and restoring it back.
15885 (back_to_previous_visible_line_start, reseat_1)
15886 (init_iterator): Empty the bidi cache "stack".
15887 (move_it_in_display_line_to): If iterator ended up at
15888 EOL, but we never saw any buffer positions smaller than
15889 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
15890 motion in bidi-reordered lines.
15891 (move_it_in_display_line_to): Record prev_method and prev_pos
15892 immediately before the call to set_iterator_to_next. Fixes cursor
15893 motion in bidi-reordered lines with stretch glyphs and strings
15894 displayed in margins. (Bug#8133) (Bug#8867)
15895 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
15896 TO_CHARPOS.
640c8776
SM
15897 (pos_visible_p): Support positions in bidi-reordered lines.
15898 Save and restore bidi cache.
0bb23927
EZ
15899
15900 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
15901 (bidi_paragraph_info): Delete unused struct.
15902 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
15903 (bidi_cache_start): New variable.
15904 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
15905 to zero.
15906 (bidi_cache_fetch_state, bidi_cache_search)
15907 (bidi_cache_find_level_change, bidi_cache_iterator_state)
15908 (bidi_cache_find, bidi_peek_at_next_level)
15909 (bidi_level_of_next_char, bidi_find_other_level_edge)
15910 (bidi_move_to_visually_next): Compare cache index with
15911 bidi_cache_start rather than with zero.
15912 (bidi_fetch_char): Accept new argument STRING; all callers
15913 changed. Support iteration over a string. Support strings with
15914 display properties. Support unibyte strings. Fix the type of
15915 `len' according to what STRING_CHAR_AND_LENGTH expects.
15916 (bidi_paragraph_init, bidi_resolve_explicit_1)
15917 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
15918 (bidi_level_of_next_char, bidi_move_to_visually_next):
15919 Support iteration over a string.
0bb23927
EZ
15920 (bidi_set_sor_type, bidi_resolve_explicit_1)
15921 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
15922 can now be zero (for strings); special values 0 and -1 were
15923 changed to -1 and -2, respectively.
15924 (bidi_char_at_pos): New function.
15925 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
15926 Call it instead of FETCH_MULTIBYTE_CHAR.
15927 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
15928 initialized to valid values.
15929 (bidi_init_it): Don't initialize charpos and bytepos with invalid
15930 values.
15931 (bidi_level_of_next_char): Allow the sentinel "position" to pass
15932 the test for valid cached positions. Fix the logic for looking up
15933 the sentinel state in the cache. GCPRO the Lisp string we are
15934 iterating.
15935 (bidi_push_it, bidi_pop_it): New functions.
15936 (bidi_initialize): Initialize the bidi cache start stack pointer.
15937 (bidi_cache_ensure_space): New function, refactored from part of
15938 bidi_cache_iterator_state. Don't assume the required size is just
15939 one BIDI_CACHE_CHUNK away.
15940 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
15941 (bidi_count_bytes, bidi_char_at_pos): New functions.
15942 (bidi_cache_search): Don't assume bidi_cache_last_idx is
15943 always valid if bidi_cache_idx is valid.
15944 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
15945 is valid if it's going to be used.
15946 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
15947 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
15948 (bidi_cache_find_level_change, bidi_cache_ensure_space)
15949 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
15950 (bidi_find_other_level_edge, bidi_cache_start_stack):
15951 All variables related to cache indices are now EMACS_INT.
c965adc5 15952
0bb23927
EZ
15953 * dispextern.h (struct bidi_string_data): New structure.
15954 (struct bidi_it): New member `string'. Make flag members be 1-bit
15955 fields, and put them last in the struct.
640c8776
SM
15956 (compute_display_string_pos, compute_display_string_end):
15957 Update prototypes.
0bb23927
EZ
15958 (bidi_push_it, bidi_pop_it): Add prototypes.
15959 (struct iterator_stack_entry): New members bidi_p,
15960 paragraph_embedding, and from_disp_prop_p.
15961 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
15962 (bidi_shelve_cache, bidi_unshelve_cache):
15963 Declare prototypes.
0bb23927
EZ
15964
15965 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
15966 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
15967 and vector-like objects.
15968
15969 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
15970 cache around display iteration.
15971
15972 * window.c (Fwindow_end, window_scroll_pixel_based)
15973 (displayed_window_lines, Frecenter): Save and restore the bidi
15974 cache around display iteration.
15975
3bbd2265
LMI
159762011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
15977
15978 * editfns.c (Fdelete_region): Clarify the use of the named
15979 parameters (bug#6788).
15980
adc47434
MR
159812011-07-14 Martin Rudalics <rudalics@gmx.at>
15982
15983 * indent.c (Fvertical_motion): Set and restore w->pointm when
15984 saving and restoring the window's buffer (Bug#9006).
15985
837c31f8
LMI
159862011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
15987
15988 * editfns.c (Fstring_to_char): Clarify just what is returned
15989 (bug#6576). Text by Eli Zaretskii.
15990
ac389d0c
JB
159912011-07-13 Juanma Barranquero <lekktu@gmail.com>
15992
15993 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
15994
0be0ce47
EZ
159952011-07-13 Eli Zaretskii <eliz@gnu.org>
15996
15997 * buffer.c (mmap_find): Fix a typo.
15998
cd18e7e3
JB
159992011-07-13 Johan Bockgård <bojohan@gnu.org>
16000
16001 Fix execution of x selection hooks.
16002 * xselect.c (Qx_lost_selection_functions)
16003 (Qx_sent_selection_functions): New vars.
16004 (syms_of_xselect): DEFSYM them.
16005 (x_handle_selection_request): Pass Qx_sent_selection_functions
16006 rather than Vx_sent_selection_functions to Frun_hook_with_args.
16007 (x_handle_selection_clear,x_clear_frame_selections):
16008 Pass Qx_lost_selection_functions rather than
16009 Vx_lost_selection_functions to Frun_hook_with_args.
16010
47ea7f44
PE
160112011-07-13 Paul Eggert <eggert@cs.ucla.edu>
16012
ac389d0c 16013 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
16014 The old code sometimes used this field without initializing it.
16015
47ea7f44
PE
16016 * alloc.c (gc_sweep): Don't read past end of array.
16017 In theory, the old code could also have corrupted Emacs internals,
16018 though it'd be very unlikely.
16019
bc985c87
AS
160202011-07-12 Andreas Schwab <schwab@linux-m68k.org>
16021
16022 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 16023 argument. (Bug#4026)
bc985c87 16024
0cf34688
LMI
160252011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
16026
b3dadd76
LMI
16027 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
16028 key" (bug#4257).
16029
0cf34688
LMI
16030 * window.c (Fset_window_start): Doc fix (bug#4199).
16031 (Fset_window_hscroll): Ditto.
16032
270768cd
PE
160332011-07-12 Paul Eggert <eggert@cs.ucla.edu>
16034
077e3dda 16035 Fix minor new problems caught by GCC 4.6.1.
270768cd 16036 * term.c (init_tty): Remove unused local.
490011a6 16037 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 16038 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 16039 not used otherwise.
270768cd 16040
b1f58454
CY
160412011-07-12 Chong Yidong <cyd@stupidchicken.com>
16042
16043 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
16044
22b9578d
LMI
160452011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
16046
6e70ab07
LMI
16047 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
16048 are the mini-buffer and the echo area (bug#3320).
16049
22b9578d
LMI
16050 * term.c (init_tty): Remove support for supdup, c10 and perq
16051 terminals, which are no longer supported (bug#1482).
16052
8974cc9f
JB
160532011-07-10 Johan Bockgård <bojohan@gnu.org>
16054
16055 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
16056
a560d974
JD
160572011-07-10 Jan Djärv <jan.h.d@swipnet.se>
16058
16059 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
16060 for non-popups (Bug#3642).
16061
1dae0f0a
AS
160622011-07-10 Andreas Schwab <schwab@linux-m68k.org>
16063
268c2c36 16064 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 16065 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
16066 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
16067 * cm.c (losecursor): Likewise.
1dae0f0a
AS
16068 * data.c (fmod): Likewise.
16069 * dispnew.c (swap_glyphs_in_rows): Likewise.
16070 * emacs.c (memory_warning_signal): Likewise.
16071 * floatfns.c (float_error): Likewise.
16072 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
16073 (otf_open, font_otf_capability, generate_otf_features)
16074 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
16075 Likewise.
16076 * image.c (pbm_read_file): Likewise.
16077 * indent.c (string_display_width): Likewise.
16078 * intervals.c (check_for_interval, search_for_interval)
16079 (inc_interval_count, count_intervals, root_interval)
16080 (adjust_intervals_for_insertion, make_new_interval): Likewise.
16081 * lread.c (defalias): Likewise.
268c2c36 16082 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
16083 * regex.c (set_image_of_range_1, set_image_of_range)
16084 (regex_grow_registers): Likewise.
16085 * sysdep.c (strerror): Likewise.
16086 * termcap.c (valid_filename_p, tprint, main): Likewise.
16087 * tparam.c (main): Likewise.
16088 * unexhp9k800.c (run_time_remap, save_data_space)
16089 (update_file_ptrs, read_header, write_header, calculate_checksum)
16090 (copy_file, copy_rest, display_header): Likewise.
16091 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
16092 Likewise.
16093 * xdisp.c (check_it): Likewise.
16094 * xfaces.c (register_color, unregister_color, unregister_colors):
16095 Likewise.
16096 * xfns.c (print_fontset_result): Likewise.
16097 * xrdb.c (member, fatal, main): Likewise.
16098
99033785
PE
160992011-07-10 Paul Eggert <eggert@cs.ucla.edu>
16100
16101 Fix minor problems found by static checking (Bug#9031).
16102 * chartab.c (char_table_set_range, map_sub_char_table):
16103 Remove unused locals.
16104 (uniprop_table): Now static.
16105 * composite.c (_work_char): Remove unused static var.
16106
9cb2ac56
JB
161072011-07-09 Juanma Barranquero <lekktu@gmail.com>
16108
16109 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
16110
f25661f0
JD
161112011-07-09 Jan Djärv <jan.h.d@swipnet.se>
16112
16113 * gtkutil.c (qttip_cb): Remove code without function.
16114
8278c4fe
EZ
161152011-07-09 Eli Zaretskii <eliz@gnu.org>
16116
16117 * w32.c (pthread_sigmask): New stub.
16118
1692ae2d 161192011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 16120
8a6ebd58 16121 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
16122 sigprocmask is portable only for single-threaded applications, and
16123 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
16124 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
16125 (LIBES): Use it.
16126 * callproc.c (Fcall_process):
16127 * process.c (create_process):
16128 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
16129 Use pthread_sigmask, not sigprocmask.
123403e4 16130
1b854618
JD
161312011-07-08 Jan Djärv <jan.h.d@swipnet.se>
16132
16133 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
16134 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
16135 wrong (Bug#8591).
16136
3fe4b549
JD
161372011-07-08 Jan Djärv <jan.h.d@swipnet.se>
16138
0ce7e563
JD
16139 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
16140 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
16141 (xg_hide_tooltip): Fix comment.
16142
3fe4b549
JD
16143 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
16144 in registerServicesMenuSendTypes.
16145 (validRequestorForSendType): Don't check ns_return_types.
16146
16147 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
16148 ns_return_type.
16149
5df75e47
JR
161502011-07-08 Jason Rumney <jasonr@gnu.org>
16151
22610910
JR
16152 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
16153 SH_SHOW for hidden windows (Bug#5482).
16154
5df75e47
JR
16155 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
16156 frame struct members of non-existent frames (Bug#6284).
16157
699c10bd
JD
161582011-07-08 Jan Djärv <jan.h.d@swipnet.se>
16159
4393663b
JD
16160 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
16161 variable firstTime not needed on OSX >= 10.6.
16162 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
16163 >= 10.5. Use setKnobProportion, setDoubleValue.
16164
16165 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
16166 (MAC_OS_X_VERSION_10_5): Define if not defined.
16167 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
16168 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
16169 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
16170
16171 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 16172 cString and lossyCString on OSX >= 10.4.
4393663b 16173
58179cce 16174 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
16175 sizeToFit on OSX >= 10.2.
16176
16177 * nsimage.m (allocInitFromFile): Don't use deprecated method
16178 bestRepresentationForDevice on OSX >= 10.6.
16179
16180 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
16181 to avoid warning.
16182
16183 * emacs.c: Declare unexec_init_emacs_zone.
16184
a63e0781
JD
16185 * nsgui.h: Fix compiler warning about gnulib redefining verify.
16186
699c10bd
JD
16187 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
16188
16189 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
16190 on svcsMenu (Bug#8842).
16191
16192 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
16193 ns_return_types.
16194 (Fns_list_services): Just return Qnil on 10.6, code not working there.
16195
16196 * nsterm.m (QUTF8_STRING): Declare.
16197 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
16198 (validRequestorForSendType): Return type is (id).
16199 Change indexOfObjectIdenticalTo to indexOfObject.
16200 Check if we have local selection before returning self (Bug#8842).
16201 (writeSelectionToPasteboard): Put local selection into paste board
16202 if we have a local selection (Bug#8842).
16203 (syms_of_nsterm): DEFSYM QUTF8_STRING.
16204
16205 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
16206 (ns_get_local_selection): Declare.
16207
54e10184
LMI
162082011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
16209
9888ff71
LMI
16210 * keymap.c (describe_map_tree): Don't insert a double newline at
16211 the end of the buffer (bug#1169) and return whether we inserted
16212 something.
16213
54e10184
LMI
16214 * callint.c (Fcall_interactively): Change "reading args" to
16215 "providing args" to try to clarify what it does (bug#1010).
16216
15fa4783
KH
162172011-07-07 Kenichi Handa <handa@m17n.org>
16218
16219 * composite.c (composition_compute_stop_pos): Ignore a static
16220 composition starting before CHARPOS (Bug#8915).
16221
16222 * xdisp.c (handle_composition_prop): Likewise.
16223
a8815b00
EZ
162242011-07-07 Eli Zaretskii <eliz@gnu.org>
16225
16226 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
16227 (Bug#9015)
16228
ef7b981d 162292011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
16230
16231 * character.h (unicode_category_t): New enum type.
16232
16233 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
16234 (Qchar_code_property_table): New variable.
16235 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
16236 (UNIPROP_COMPRESSED_FORM_P): New macros.
16237 (char_table_ascii): Uncompress the compressed values.
16238 (sub_char_table_ref): New arg is_uniprop. Callers changed.
16239 Uncompress the compressed values.
ac389d0c 16240 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
16241 (char_table_ref_and_range): Uncompress the compressed values.
16242 (sub_char_table_set): New arg is_uniprop. Callers changed.
16243 Uncompress the compressed values.
16244 (sub_char_table_set_range): Args changed. Callers changed.
16245 (char_table_set_range): Adjuted for the above change.
16246 (map_sub_char_table): Delete args default_val and parent. Add arg
16247 top. Give decoded values to a Lisp function.
640c8776 16248 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
16249 values to a Lisp function. Gcpro more variables.
16250 (uniprop_table_uncompress)
16251 (uniprop_decode_value_run_length): New functions.
16252 (uniprop_decoder, uniprop_decoder_count): New variables.
16253 (uniprop_get_decoder, uniprop_encode_value_character)
16254 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
16255 New functions.
16256 (uniprop_encoder, uniprop_encoder_count): New variables.
16257 (uniprop_get_encoder, uniprop_table)
16258 (Funicode_property_table_internal, Fget_unicode_property_internal)
16259 (Fput_unicode_property_internal): New functions.
16260 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
16261 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 16262 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
16263 char-code-property-alist.
16264
640c8776 16265 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
16266 Vunicode_category_table.
16267
640c8776 16268 * font.c (font_range): Adjust for the change of
c805dec0
KH
16269 Vunicode_category_table.
16270
76b397fb
DN
162712011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
16272
16273 * m/iris4d.h: Remove file, move contents ...
16274 * s/irix6-5.h: ... here.
16275
22b4128e
PE
162762011-07-06 Paul Eggert <eggert@cs.ucla.edu>
16277
16278 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
16279 * alloc.c (mark_buffer):
16280 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
16281 (clone_per_buffer_values): Don't assume that
22b4128e
PE
16282 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
16283 This isn't true in general, and it's particularly not true
16284 if Emacs is configured with --with-wide-int.
16285 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
16286 New macros, used in the buffer.c change.
16287
869795d6
JD
162882011-07-05 Jan Djärv <jan.h.d@swipnet.se>
16289
16290 * xsettings.c: Use both GConf and GSettings if both are available.
16291 (store_config_changed_event): Add comment.
16292 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
16293 (store_tool_bar_style_changed): New functions.
5e617bc2 16294 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
16295 (struct xsettings): Move font inside HAVE_XFT.
16296 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 16297 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 16298 Move inside HAVE_XFT.
640c8776 16299 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
16300 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
16301 also.
16302 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 16303 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 16304 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
16305 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
16306 (parse_settings): Move check for font inside HAVE_XFT.
16307 (read_settings, apply_xft_settings): Add comment.
16308 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
16309 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
16310 call store_font_name_changed.
16311 (xft_settings_event): Add comment.
16312 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
16313 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
16314 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
16315 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
16316 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
16317 (xsettings_get_system_font, xsettings_get_system_normal_font):
16318 Add comment.
869795d6 16319
d8ed26bd
PE
163202011-07-05 Paul Eggert <eggert@cs.ucla.edu>
16321
16322 Random fixes. E.g., (random) never returned negative values.
16323 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
16324 subseconds part to the entropy, as that's a bit more random.
16325 Prefer signed to unsigned, since the signedness doesn't matter and
16326 in general we prefer signed. When given a limit, use a
16327 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
16328 latter isn't right if USE_2_TAGS_FOR_INTS.
16329 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
16330 not 0..VALMASK. Don't discard "excess" bits that random () returns.
16331
cabf1cac
SM
163322011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
16333
16334 * textprop.c (text_property_stickiness):
16335 Obey Vtext_property_default_nonsticky.
16336 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
16337 * w32fns.c (syms_of_w32fns):
16338 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
16339
6e9b2be9
PE
163402011-07-04 Paul Eggert <eggert@cs.ucla.edu>
16341
16342 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
16343 This is more efficient than Ffile_directory_p and avoids a minor race.
16344
90186c68
LMI
163452011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
16346
7c301272
LMI
16347 * buffer.c (Foverlay_put): Say what the return value is
16348 (bug#7835).
16349
c4f2d8d4
LMI
16350 * fileio.c (barf_or_query_if_file_exists): Check first if the file
16351 is a directory before asking whether to use the file name
16352 (bug#7564).
ad637907
LMI
16353 (barf_or_query_if_file_exists): Make the "File is a directory"
16354 error be more correct.
c4f2d8d4 16355
90186c68
LMI
16356 * fns.c (Frequire): Remove the mention of the .gz files, since
16357 that's installation-specific, but keep the mention of
16358 `get-load-suffixes'.
16359
da64016e
PE
163602011-07-04 Paul Eggert <eggert@cs.ucla.edu>
16361
16362 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
16363 Report string overflow if the output is too long.
16364
7d47b580
JB
163652011-07-04 Juanma Barranquero <lekktu@gmail.com>
16366
a555cb87
JB
16367 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
16368 (syms_of_gnutls): Remove duplicate DEFSYM for
16369 Qgnutls_bootprop_verify_hostname_error, an error for
16370 Qgnutls_bootprop_verify_error (which is no longer used).
16371
7d47b580
JB
16372 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
16373 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
16374 Also (re)move comments that are misplaced or no longer relevant.
16375
1e49bfab
LMI
163762011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16377
16378 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
16379
1485f4c0
CY
163802011-07-03 Chong Yidong <cyd@stupidchicken.com>
16381
16382 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
16383 and background color parameters if they have been changed.
16384
a9ab721e
LMI
163852011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16386
16387 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
16388
cf7cff57
PE
163892011-07-03 Paul Eggert <eggert@cs.ucla.edu>
16390
2e13213d
PE
16391 * xsettings.c (SYSTEM_FONT): Define only when used.
16392 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
16393
cf7cff57
PE
16394 * keymap.c (access_keymap_1): Now static.
16395
7a8e04f7
CY
163962011-07-02 Chong Yidong <cyd@stupidchicken.com>
16397
16398 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
16399 leave any prefix arg for the up event (Bug#1586).
16400
61352f62
LMI
164012011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
16402
69bb1ef7
LMI
16403 * lread.c (syms_of_lread): Mention single symbols defined by
16404 `defvar' or `defconst' (bug#7154).
16405
61352f62 16406 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 16407 (Frequire): Mention get-load-suffixes.
61352f62 16408
28545e04
MR
164092011-07-02 Martin Rudalics <rudalics@gmx.at>
16410
16411 * window.h (window): Remove clone_number slot.
16412 * window.c (Fwindow_clone_number, Fset_window_clone_number):
16413 Remove.
16414 (make_parent_window, make_window, saved_window)
16415 (Fset_window_configuration, save_window_save): Don't deal with
16416 clone numbers.
16417 * buffer.c (Qclone_number): Remove declaration.
16418 (sort_overlays, overlay_strings): Don't deal with clone numbers.
16419
3349e122
SM
164202011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
16421
16422 Add multiple inheritance to keymaps.
16423 * keymap.c (Fmake_composed_keymap): New function.
16424 (Fset_keymap_parent): Simplify.
16425 (fix_submap_inheritance): Remove.
16426 (access_keymap_1): New function extracted from access_keymap to handle
16427 embedded parents and handle lists of maps.
16428 (access_keymap): Use it.
16429 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
16430 (Fcopy_keymap): Handle embedded parents.
16431 (Fcommand_remapping, define_as_prefix): Simplify.
16432 (Fkey_binding): Simplify.
16433 (syms_of_keymap): Move minibuffer-local-completion-map,
16434 minibuffer-local-filename-completion-map,
16435 minibuffer-local-must-match-map, and
16436 minibuffer-local-filename-must-match-map to Elisp.
16437 (syms_of_keymap): Defsubr make-composed-keymap.
16438 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
16439 (parse_menu_item): Trivial simplification.
16440
3279eb87
GM
164412011-07-01 Glenn Morris <rgm@gnu.org>
16442
16443 * Makefile.in (SETTINGS_LIBS): Fix typo.
16444
39cb9e56 164452011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
16446
16447 * coding.c (Fencode_coding_string): Record the last coding system
16448 used, as the function doc string says (bug#8738).
16449
0949d2b6
JD
164502011-07-01 Jan Djärv <jan.h.d@swipnet.se>
16451
16452 * xsettings.c (store_monospaced_changed): Take new font as arg and
16453 check for change against current_mono_font.
16454 (EMACS_TYPE_SETTINGS): Remove this and related defines.
16455 (emacs_settings_constructor, emacs_settings_get_property)
16456 (emacs_settings_set_property, emacs_settings_class_init)
16457 (emacs_settings_init, gsettings_obj): Remove.
16458 (something_changedCB): New function for HAVE_GSETTINGS.
16459 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
16460 with value as argument.
16461 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
16462 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 16463 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
16464 "changed".
16465
16466 * xgselect.c: Add defined (HAVE_GSETTINGS).
16467 (xgselect_initialize): Ditto.
16468
16469 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
16470 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
16471 xg_select.
16472
bbc6b304
PE
164732011-07-01 Paul Eggert <eggert@cs.ucla.edu>
16474
16475 * eval.c (struct backtrace): Simplify and port the data structure.
16476 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
16477 signed bit field, as this assumption is not portable and it makes
16478 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
16479 "char debug_on_exit : 1" as this is not portable either; instead,
16480 use the portable "unsigned int debug_on_exit : 1". Remove unused
16481 member evalargs. Remove obsolete comments about cc bombing out.
16482
9851bfc5
JD
164832011-06-30 Jan Djärv <jan.h.d@swipnet.se>
16484
51bb811f 16485 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
16486 Let HAVE_GSETTINGS override HAVE_GCONF.
16487 (store_monospaced_changed): New function.
16488 (EMACS_SETTINGS): A new type derived from GObject to handle
16489 GSettings notifications.
16490 (emacs_settings_constructor, emacs_settings_get_property)
16491 (emacs_settings_set_property, emacs_settings_class_init):
16492 New functions.
16493 (gsettings_client, gsettings_obj): New variables.
16494 (GSETTINGS_SCHEMA): New define.
16495 (something_changedCB): Call store_monospaced_changed.
16496 (init_gsettings): New function.
16497 (xsettings_initialize): Call init_gsettings.
16498 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
16499 to NULL.
16500
640c8776 16501 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
16502 GCONF_CFLAGS/LIBS.
16503
5386012d
MR
165042011-06-29 Martin Rudalics <rudalics@gmx.at>
16505
16506 * window.c (resize_root_window, grow_mini_window)
16507 (shrink_mini_window): Rename Qresize_root_window to
16508 Qwindow_resize_root_window and Qresize_root_window_vertically to
16509 Qwindow_resize_root_window_vertically.
16510
f13e0b08
PE
165112011-06-28 Paul Eggert <eggert@cs.ucla.edu>
16512
16513 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
16514
94515237
JB
165152011-06-27 Juanma Barranquero <lekktu@gmail.com>
16516
16517 * makefile.w32-in: Redesign dependencies so they reflect more
16518 clearly which files are directly included by each source file,
16519 and not through other includes.
16520
e43b6e43
MR
165212011-06-27 Martin Rudalics <rudalics@gmx.at>
16522
16523 * buffer.c (Qclone_number): Declare static and DEFSYM it.
16524 (sort_overlays, overlay_strings): When an overlay's clone number
16525 matches the window's clone number process the overlay even if
16526 the overlay's window property doesn't match the current window.
16527
d68443dc
MR
16528 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
16529 (Fwindow_hchild): Rename to Fwindow_left_child.
16530 (Fwindow_next): Rename to Fwindow_next_sibling.
16531 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
16532 (resize_window_check): Rename to window_resize_check.
16533 (resize_window_apply): Rename to window_resize_apply.
16534 (Fresize_window_apply): Rename to Fwindow_resize_apply.
16535 (Fdelete_other_windows_internal, resize_frame_windows)
16536 (Fsplit_window_internal, Fdelete_window_internal)
16537 (grow_mini_window, shrink_mini_window)
16538 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 16539
c7e73be5
JD
165402011-06-26 Jan Djärv <jan.h.d@swipnet.se>
16541
16542 * emacsgtkfixed.h: State that this is only used with Gtk+3.
16543 (emacs_fixed_set_min_size): Remove.
16544 (emacs_fixed_new): Take frame as argument.
16545
16546 * emacsgtkfixed.c: State that this is only used with Gtk+3.
16547 (_EmacsFixedPrivate): Remove minwidth/height.
16548 Add struct frame *f.
16549 (emacs_fixed_init): Initialize priv->f.
16550 (get_parent_class, emacs_fixed_set_min_size): Remove.
16551 (emacs_fixed_new): Set priv->f to argument.
16552 (emacs_fixed_get_preferred_width)
16553 (emacs_fixed_get_preferred_height): Use min_width/height from
16554 frames size_hint to set minimum and natural (Bug#8919).
16555 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
16556 and use min_width/height from frames size_hint to set
16557 min_width/height (Bug#8919).
16558
16559 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
16560 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
16561 Fix indentation.
c7e73be5 16562
cf99dcf8
EZ
165632011-06-26 Eli Zaretskii <eliz@gnu.org>
16564
16565 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
16566 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
16567 called at ZV.
16568
029529ac
CY
165692011-06-26 Chong Yidong <cyd@stupidchicken.com>
16570
16571 * process.c (wait_reading_process_output): Bypass select if
16572 waiting for a cell while ignoring keyboard input, and input is
16573 pending. Suggested by Jan Djärv (Bug#8869).
16574
7a7ef429
PE
165752011-06-25 Paul Eggert <eggert@cs.ucla.edu>
16576
16577 Use gnulib's dup2 module instead of rolling our own.
16578 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
16579
11fdef7d 165802011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
16581
16582 * dispnew.c (scrolling_window): Before scrolling, turn off a
16583 mouse-highlight in the window being scrolled.
16584
cd3520a4
JB
165852011-06-24 Juanma Barranquero <lekktu@gmail.com>
16586
16587 Move DEFSYM to lisp.h and use everywhere.
16588
16589 * character.h (DEFSYM): Move declaration...
16590 * lisp.h (DEFSYM): ...here.
16591
16592 * gnutls.c:
16593 * minibuf.c:
16594 * w32menu.c:
16595 * w32proc.c:
16596 * w32select.c: Don't include character.h.
16597
16598 * alloc.c (syms_of_alloc):
16599 * buffer.c (syms_of_buffer):
16600 * bytecode.c (syms_of_bytecode):
16601 * callint.c (syms_of_callint):
16602 * casefiddle.c (syms_of_casefiddle):
16603 * casetab.c (init_casetab_once):
16604 * category.c (init_category_once, syms_of_category):
16605 * ccl.c (syms_of_ccl):
16606 * cmds.c (syms_of_cmds):
16607 * composite.c (syms_of_composite):
16608 * dbusbind.c (syms_of_dbusbind):
16609 * dired.c (syms_of_dired):
16610 * dispnew.c (syms_of_display):
16611 * doc.c (syms_of_doc):
16612 * editfns.c (syms_of_editfns):
16613 * emacs.c (syms_of_emacs):
16614 * eval.c (syms_of_eval):
16615 * fileio.c (syms_of_fileio):
16616 * fns.c (syms_of_fns):
16617 * frame.c (syms_of_frame):
16618 * fringe.c (syms_of_fringe):
16619 * insdel.c (syms_of_insdel):
16620 * keymap.c (syms_of_keymap):
16621 * lread.c (init_obarray, syms_of_lread):
16622 * macros.c (syms_of_macros):
16623 * msdos.c (syms_of_msdos):
16624 * print.c (syms_of_print):
16625 * process.c (syms_of_process):
16626 * search.c (syms_of_search):
16627 * sound.c (syms_of_sound):
16628 * syntax.c (init_syntax_once, syms_of_syntax):
16629 * terminal.c (syms_of_terminal):
16630 * textprop.c (syms_of_textprop):
16631 * undo.c (syms_of_undo):
16632 * w32.c (globals_of_w32):
16633 * window.c (syms_of_window):
16634 * xdisp.c (syms_of_xdisp):
16635 * xfaces.c (syms_of_xfaces):
16636 * xfns.c (syms_of_xfns):
16637 * xmenu.c (syms_of_xmenu):
16638 * xsettings.c (syms_of_xsettings):
16639 * xterm.c (syms_of_xterm): Use DEFSYM.
16640
4228cf16
TZ
166412011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
16642
cd3520a4 16643 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 16644
7fcccf1e
PE
166452011-06-23 Paul Eggert <eggert@cs.ucla.edu>
16646
7efb4e0e
PE
16647 Integer and buffer overflow fixes (Bug#8873).
16648
ff5844ad
PE
16649 * print.c (printchar, strout): Check for string overflow.
16650 (PRINTPREPARE, printchar, strout):
16651 Don't set size unless allocation succeeds.
16652
90532f02
PE
16653 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
16654 for sizes. Check for string overflow more accurately.
16655 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
16656
6d84508d
PE
16657 * macros.c: Integer and buffer overflow fixes.
16658 * keyboard.h (struct keyboard.kbd_macro_bufsize):
16659 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
16660 Use ptrdiff_t, not int, for sizes.
16661 Don't increment bufsize until after realloc succeeds.
16662 Check for size-calculation overflow.
16663 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
16664
437b2cb4
PE
16665 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
16666
8b9ac8b4
PE
16667 * lread.c: Integer overflow fixes.
16668 (read_integer): Radix is now EMACS_INT, not int,
16669 to improve quality of diagnostics for out-of-range radices.
16670 Calculate buffer size correctly for out-of-range radices.
16671 (read1): Check for integer overflow in radices, and in
16672 read-circle numbers.
82cb60d3
PE
16673 (read_escape): Avoid int overflow.
16674 (Fload, openp, read_buffer_size, read1)
16675 (substitute_object_recurse, read_vector, read_list, map_obarray):
16676 Use ptrdiff_t, not int, for sizes.
16677 (read1): Use EMACS_INT, not int, for sizes.
20270765 16678 Check for size overflow.
8b9ac8b4 16679
7fcccf1e
PE
16680 * image.c (cache_image): Check for size arithmetic overflow.
16681
bfbbd7e7
PE
16682 * lread.c: Integer overflow issues.
16683 (saved_doc_string_size, saved_doc_string_length)
16684 (prev_saved_doc_string_size, prev_saved_doc_string_length):
16685 Now ptrdiff_t, not int.
16686 (read1): Don't assume doc string length fits in int. Check for
16687 out-of-range doc string lengths.
16688 (read_list): Don't assume file position fits in int.
39019e54 16689 (read_escape): Check for hex character overflow.
bfbbd7e7 16690
4e323265
LL
166912011-06-22 Leo Liu <sdl.web@gmail.com>
16692
16693 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
16694 Move to minibuffer.el.
16695
85fece3e
PE
166962011-06-22 Paul Eggert <eggert@cs.ucla.edu>
16697
20b84ce9 16698 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
16699 The following patches are for when GLYPH_DEBUG && !XASSERT.
16700 * dispextern.h (trace_redisplay_p, dump_glyph_string):
16701 * dispnew.c (flush_stdout):
16702 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
16703 Mark as externally visible.
16704 * dispnew.c (check_window_matrix_pointers): Now static.
16705 * dispnew.c (window_to_frame_vpos):
16706 * xfns.c (unwind_create_frame):
16707 * xterm.c (x_check_font): Remove unused local.
16708 * scroll.c (CHECK_BOUNDS):
16709 * xfaces.c (cache_fache): Rename local to avoid shadowing.
16710 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
16711 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
16712 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
16713 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
16714 Now static.
16715 (debug_method_add): Use va_list and vsprintf rather than relying
16716 on undefined behavior with wrong number of arguments.
16717 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
16718 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
16719 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
16720 since we're not interested in debugging glyphs with old libraries.
16721 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
16722 GCC 4.6.0's static checking.
16723
0766b489
PE
167242011-06-22 Paul Eggert <eggert@cs.ucla.edu>
16725
31fd4b32
PE
16726 Integer overflow and signedness fixes (Bug#8873).
16727 A few related buffer overrun fixes, too.
16728
b79e8648
PE
16729 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
16730
0766b489
PE
16731 * dispextern.h (struct face.stipple):
16732 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
16733 (x_bitmap_mask, x_allocate_bitmap_record)
16734 (x_create_bitmap_from_data, x_create_bitmap_from_file)
16735 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
16736 (x_create_bitmap_from_xpm_data):
16737 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
16738 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
16739 (.bitmaps_last):
16740 * xfaces.c (load_pixmap):
16741 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
16742 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
16743 (.bitmaps_last, struct x_output.icon_bitmap):
16744 Use ptrdiff_t, not int, for bitmap indexes.
16745 (x_allocate_bitmap_record): Check for size overflow.
16746 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
16747
b081724f
PE
16748 Use ptrdiff_t, not int, for overlay counts.
16749 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
16750 * editfns.c (overlays_around, get_pos_property):
16751 * textprop.c (get_char_property_and_overlay):
16752 * xdisp.c (next_overlay_change, note_mouse_highlight):
16753 * xfaces.c (face_at_buffer_position):
21514da7
PE
16754 * buffer.c (OVERLAY_COUNT_MAX): New macro.
16755 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
16756 (Fnext_overlay_change, Fprevious_overlay_change)
16757 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 16758 Use ptrdiff_t, not int, for sizes.
21514da7 16759 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 16760
3de73e5e
PE
16761 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
16762
2606c57b
PE
16763 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
16764 (x_session_initialize): Do not assume string length fits in int.
16765
aaafe47a
PE
16766 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
16767 This is unlikely, but can occur if DPI is outlandish.
16768
2674ddc8 16769 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
16770 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
16771
28154962
PE
16772 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
16773 * xrdb.c (magic_file_p, search_magic_path):
16774 Omit last arg SUFFIX; it was always 0. All callers changed.
16775 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
16776
7de51af5
PE
16777 * xfont.c (xfont_match): Avoid need for strlen.
16778
25ed6cc3
PE
16779 * xfns.c: Don't assume strlen fits in int.
16780 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
16781
4eab31dd
PE
16782 * xdisp.c (message_log_check_duplicate): Return intmax_t,
16783 not unsigned long, as we prefer signed integers. All callers changed.
16784 Detect integer overflow in repeat count.
16785 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 16786 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 16787
171e2a58
PE
16788 * termcap.c: Don't assume sizes fit in int and never overflow.
16789 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
16790 (gobble_line): Check for size-calculation overflow.
16791
ad39faca 16792 * minibuf.c (Fread_buffer):
6e5bb2dc 16793 * lread.c (intern, intern_c_string):
74ca2eb3
PE
16794 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
16795 Don't assume string length fits in int.
16796
52c61c22 16797 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
16798 * gtkutil.c (style_changed_cb): Avoid need for strlen.
16799
b5b8c9e5
PE
16800 * font.c: Don't assume string length fits in int.
16801 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
16802 Use ptrdiff_t, not int.
ccd6111c
PE
16803 (font_intern_prop): Don't assume string length fits in int.
16804 Don't assume integer property fits in fixnum.
16805 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 16806
882f0d81 16807 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 16808 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
16809 Reformulate so as not to need the command string.
16810 Invoke gzip -cd rather than gunzip, as it's more portable.
16811 (lock_info_type, lock_file_1, lock_file):
16812 Don't assume pid_t and time_t fit in unsigned long.
16813 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
16814 (current_lock_owner): Prefer signed type for sizes.
16815 Use memcpy, not strncpy, where memcpy is what is really wanted.
16816 Don't assume (via atoi) that time_t and pid_t fit in int.
16817 Check for time_t and/or pid_t out of range, e.g., via a network share.
16818 Don't alloca where an auto var works fine.
16819
93f4cf88
PE
16820 * fileio.c: Fix some integer overflow issues.
16821 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
16822 Don't assume string length fits in int.
16823 (directory_file_name): Don't assume string length fits in long.
16824 (make_temp_name): Don't assume pid fits in int, or that its print
16825 length is less than 20.
16826
f3e92b69
PE
16827 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
16828
1bfdaf10
PE
16829 * coding.c (make_subsidiaries): Don't assume string length fits in int.
16830
35016e9a
PE
16831 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
16832
3d1e65a1
PE
16833 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
16834 We prefer signed integers, even for size calculations.
16835
0b963a93
PE
16836 * emacs.c: Don't assume string length fits in 'int'.
16837 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
16838 (main): Don't invoke strlen when not needed.
16839
573f4b54
PE
16840 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
16841 (XD_DEBUG_MESSAGE): Don't waste a byte.
16842
989f33ba
PE
16843 * callproc.c (getenv_internal_1, getenv_internal)
16844 (Fgetenv_internal):
965d34eb
PE
16845 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
16846
e4d29b33
PE
16847 * lread.c (invalid_syntax): Omit length argument.
16848 All uses changed. This doesn't fix a bug, but it simplifies the
16849 code away from its former Hollerith-constant appearance, and it's
16850 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 16851 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 16852
eb49b136
PE
16853 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
16854 This didn't break anything, but it didn't help either.
16855 It's confusing to put a bogus integer in a place where the actual
16856 value does not matter.
9f62aeb1 16857 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 16858 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 16859
15375a22
PE
16860 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
16861 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
16862 implementation.
b61cc01c
PE
16863 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
16864 We prefer signed types, and the value cannot exceed the EMACS_INT
16865 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
16866 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
16867 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
16868 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 16869
53b2623d
PE
16870 * indent.c (sane_tab_width): New function.
16871 (current_column, scan_for_column, Findent_to, position_indentation)
16872 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 16873 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 16874
51cab52b 16875 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 16876
f2ed8a70
PE
16877 * lisp.h (lint_assume): New macro.
16878 * composite.c (composition_gstring_put_cache):
16879 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
16880
abe80cc6
PE
16881 * editfns.c, insdel.c:
16882 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 16883
b02c740e
PE
16884 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
16885
ebc96716
PE
16886 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
16887
b4e50fa0 16888 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 16889 Use much-faster test for byte-length change.
311d5d7c 16890 Don't assume string byte-length fits in 'int'.
a4cf38e4 16891 Check that character arg fits in 'int'.
85461888 16892 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 16893
c0c1ee9f
PE
16894 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
16895
a498d7f4
PE
16896 * fns.c (concat): Catch string overflow earlier.
16897 Do not rely on integer wraparound.
16898
51cab52b
PE
16899 * dispextern.h (struct it.overlay_strings_charpos)
16900 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
16901 * xdisp.c (forward_to_next_line_start)
16902 (back_to_previous_visible_line_start)
16903 (reseat_at_next_visible_line_start, next_element_from_buffer):
16904 Don't arbitrarily truncate the value of 'selective' to int.
16905
76031fad
PE
16906 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
16907
5eb55db9
PE
16908 * composite.c: Don't truncate sizes to 'int'.
16909 (composition_gstring_p, composition_reseat_it)
16910 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
16911 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
16912 not EMACS_UINT, for indexes.
5eb55db9 16913
0703a717
PE
16914 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
16915
d6202519
PE
16916 * buffer.c: Include <verify.h>.
16917 (struct sortvec.priority, struct sortstr.priority):
8961a454 16918 Now EMACS_INT, not int.
c20998a7 16919 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
16920 (struct sortstr.size, record_overlay_string)
16921 (struct sortstrlist.size, struct sortlist.used):
16922 Don't truncate size to int.
16923 (record_overlay_string): Check for size-calculation overflow.
d6202519 16924 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 16925
d5a19415
JM
169262011-06-22 Jim Meyering <meyering@redhat.com>
16927
029529ac 16928 Don't leak an XBM-image-sized buffer
d5a19415
JM
16929 * image.c (xbm_load): Free the image buffer after using it.
16930
a9041e6c
PE
169312011-06-21 Paul Eggert <eggert@cs.ucla.edu>
16932
16933 Port to Sun C.
16934 * composite.c (find_automatic_composition): Omit needless 'return 0;'
16935 that Sun C diagnosed.
16936 * fns.c (secure_hash): Fix pointer signedness issue.
16937 * intervals.c (static_offset_intervals): New function.
16938 (offset_intervals): Use it.
16939
7f3f739f
LL
169402011-06-21 Leo Liu <sdl.web@gmail.com>
16941
16942 * deps.mk (fns.o):
16943 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
16944 sha512.h.
16945
16946 * fns.c (secure_hash): Rename from crypto_hash_function and change
16947 the first arg to accept symbols.
5b66d427 16948 (Fsecure_hash): New primitive.
7f3f739f
LL
16949 (syms_of_fns): New symbols.
16950
76147d94
DD
169512011-06-20 Deniz Dogan <deniz@dogan.se>
16952
16953 * process.c (Fset_process_buffer): Clarify return value in
16954 docstring.
16955
7d7d0045
CY
169562011-06-18 Chong Yidong <cyd@stupidchicken.com>
16957
16958 * dispnew.c (add_window_display_history): Use BVAR.
16959
16960 * xdisp.c (debug_method_add): Use BVAR.
16961 (check_window_end, dump_glyph_matrix, dump_glyph)
16962 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
16963
16964 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
16965 Likewise.
16966
16967 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
16968 check till after the cache is created in init_frame_faces.
16969
ff2bc410
SM
169702011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
16971
16972 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
16973
28177add
PE
169742011-06-16 Paul Eggert <eggert@cs.ucla.edu>
16975
dd3482fe
PE
16976 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
16977 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
16978 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
16979
393d71f3 16980 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
16981 * fileio.c (Finsert_file_contents):
16982 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
16983 Remove the old (too-loose) buffer overflow checks.
16984 They weren't needed, since make_gap checks for buffer overflow.
16985 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
16986 The old code merely checked for Emacs fixnum overflow, and relied
16987 on undefined (wraparound) behavior. The new code avoids undefined
16988 behavior, and also checks for ptrdiff_t and/or size_t overflow.
16989
2e6813b0 16990 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
16991 Tune. Don't use wider integers than needed. Don't use alloca.
16992 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 16993
599a9e4f
PE
16994 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
16995
99561444
PE
16996 * insdel.c, lisp.h (buffer_overflow): New function.
16997 (insert_from_buffer_1, replace_range, replace_range_2):
16998 * insdel.c (make_gap_larger):
16999 * editfns.c (Finsert_char):
17000 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
17001
28177add
PE
17002 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
17003
e69dafad
PE
170042011-06-15 Paul Eggert <eggert@cs.ucla.edu>
17005
4baa020d 17006 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 17007
b1c46f02
PE
17008 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
17009 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
17010
e69dafad
PE
17011 * fileio.c: Don't assume EMACS_INT fits in off_t.
17012 (emacs_lseek): New static function.
17013 (Finsert_file_contents, Fwrite_region): Use it.
17014 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
17015
566684ea
PE
17016 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
17017
e6966cd6
PE
17018 * fns.c: Don't overflow int when computing a list length.
17019 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
17020 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
17021 truncation on 64-bit hosts. Check for QUIT every
17022 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
17023 faster and is responsive enough.
17024 (Flength): Report an error instead of overflowing an integer.
17025 (Fsafe_length): Return a float if the value is not representable
17026 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 17027 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 17028 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 17029
dd0b0efb
PE
17030 * alloc.c: Check that resized vectors' lengths fit in fixnums.
17031 (header_size, word_size): New constants.
17032 (allocate_vectorlike): Don't check size overflow here.
17033 (allocate_vector): Check it here instead, since this is the only
17034 caller of allocate_vectorlike that could cause overflow.
17035 Check that the new vector's length is representable as a fixnum.
17036
86fe5cfe
PE
17037 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
17038 The previous code was bogus. For example, next_almost_prime (32)
17039 returned 39, which is undesirable as it is a multiple of 3; and
17040 next_almost_prime (24) returned 25, which is a multiple of 5 so
17041 why was the code bothering to check for multiples of 7?
17042
80e88859
PE
17043 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
17044
4a2f0ad6
PE
17045 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
17046
f66c7cf8
PE
17047 Variadic C functions now count arguments with ptrdiff_t.
17048 This partly undoes my 2011-03-30 change, which replaced int with size_t.
17049 Back then I didn't know that the Emacs coding style prefers signed int.
17050 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
17051 were being counted with int, which may truncate counts on 64-bit
17052 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
17053 * lisp.h (struct Lisp_Subr.function.aMANY)
17054 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
17055 Arg counts are now ptrdiff_t, not size_t.
17056 All variadic functions and their callers changed accordingly.
17057 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
17058 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
17059 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
17060 * callint.c (Fcall_interactively): Check arg count for overflow,
17061 to avoid potential buffer overrun. Use signed char, not 'int',
17062 for 'varies' array, so that we needn't bother to check its size
17063 calculation for overflow.
17064 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
17065 * eval.c (apply_lambda):
17066 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
17067 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
17068 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
17069
a1759b76
PE
17070 * callint.c (Fcall_interactively): Don't use index var as event count.
17071
d96be9fc
PE
17072 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
17073 * mem-limits.h (SIZE): Remove; no longer used.
17074
a690a978 17075 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 17076
578c21e6
PE
17077 Remove unnecessary casts.
17078 * xterm.c (x_term_init):
17079 * xfns.c (x_set_border_pixel):
17080 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
17081 These aren't needed now that we assume ANSI C.
17082
96f53c6c
PE
17083 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
17084 It's more likely to cause problems (due to unsigned overflow)
17085 than to cure them.
17086
83c77d31
PE
17087 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
17088
ee2079f1
PE
17089 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
17090
6da65536
PE
17091 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
17092
7147c4a4
PE
17093 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
17094
193e32d9
PE
17095 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
17096
e5533da6
PE
17097 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
17098
9910e595
PE
17099 GLYPH_CODE_FACE returns EMACS_INT, not int.
17100 * dispextern.h (merge_faces):
17101 * xfaces.c (merge_faces):
01103c44
PE
17102 * xdisp.c (get_next_display_element, next_element_from_display_vector):
17103 Don't assume EMACS_INT fits in int.
9910e595 17104
2638320e
PE
17105 * character.h (CHAR_VALID_P): Remove unused parameter.
17106 * fontset.c, lisp.h, xdisp.c: All uses changed.
17107
045eb8d9
PE
17108 * editfns.c (Ftranslate_region_internal): Omit redundant test.
17109
c1f134b5
PE
17110 * fns.c (concat): Minor tuning based on overflow analysis.
17111 This doesn't fix any bugs. Use int to hold character, instead
17112 of constantly refetching from Emacs object. Use XFASTINT, not
17113 XINT, for value known to be a character. Don't bother comparing
17114 a single byte to 0400, as it's always less.
17115
395fcb93 17116 * floatfns.c (Fexpt):
327eeec8
PE
17117 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
17118
abbd3d23
PE
17119 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
17120 for characters.
17121
684a03ef
PE
17122 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
17123
0fed43f3
PE
17124 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
17125 Without this fix, on a 64-bit host (aset S 0 4294967386) would
17126 incorrectly succeed when S was a string, because 4294967386 was
17127 truncated before it was used.
17128
8fd02eb7
PE
17129 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
17130 Otherwise, an out-of-range integer could cause undefined behavior
17131 on a 64-bit host.
17132
f8c86b69
PE
17133 * composite.c: Use int, not EMACS_INT, for characters.
17134 (fill_gstring_body, composition_compute_stop_pos): Use int, not
17135 EMACS_INT, for values that are known to be in character range.
17136 This doesn't fix any bugs but is the usual style inside Emacs and
17137 may generate better code on 32-bit machines.
17138
34206dd2
PE
17139 Make sure a 64-bit char is never passed to ENCODE_CHAR.
17140 This is for reasons similar to the recent CHAR_STRING fix.
17141 * charset.c (Fencode_char): Check that character arg is actually
17142 a character. Pass an int to ENCODE_CHAR.
17143 * charset.h (ENCODE_CHAR): Verify that the character argument is no
17144 wider than 'int', as a compile-time check to prevent future regressions
17145 in this area.
17146
c5958d4c 17147 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
17148
17149 Make sure a 64-bit char is never passed to CHAR_STRING.
17150 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
17151 by silently ignoring the top 32 bits, allowing some values
17152 that were far too large to be valid characters.
17153 * character.h: Include <verify.h>.
17154 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
17155 arguments are no wider than unsigned, as a compile-time check
17156 to prevent future regressions in this area.
17157 * data.c (Faset):
01103c44 17158 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
17159 (Fsubst_char_in_region):
17160 * fns.c (concat):
17161 * xdisp.c (decode_mode_spec_coding):
17162 Adjust to CHAR_STRING's new requirement.
17163 * editfns.c (Finsert_char, Fsubst_char_in_region):
17164 * fns.c (concat): Check that character args are actually
17165 characters. Without this test, these functions did the wrong
17166 thing with wildly out-of-range values on 64-bit hosts.
17167
d37ca623
PE
17168 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
17169 These casts should not be needed on 32-bit hosts, either.
17170 * keyboard.c (read_char):
17171 * lread.c (Fload): Remove casts to unsigned.
17172
ea204efb
PE
17173 * lisp.h (UNSIGNED_CMP): New macro.
17174 This fixes comparison bugs on 64-bit hosts.
17175 (ASCII_CHAR_P): Use it.
17176 * casefiddle.c (casify_object):
01103c44 17177 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
17178 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
17179 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
17180 * dispextern.h (FACE_FROM_ID):
17181 * keyboard.c (read_char): Use UNSIGNED_CMP.
17182
41cb286c
PE
17183 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
17184 not to EMACS_INT, to avoid GCC warning.
17185
4a1b9832
PE
17186 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
17187
55daad71
PE
17188 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
17189 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
17190 isn't needed on 32-bit machines.
8f95c75c 17191
01103c44
PE
17192 * buffer.c (Fgenerate_new_buffer_name):
17193 Use EMACS_INT for count, not int.
0ceccced 17194 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
17195
17196 * data.c (Qcompiled_function): Now static.
17197
c6f072e7
PE
17198 * window.c (window_body_lines): Now static.
17199
20ce5912
PE
17200 * image.c (gif_load): Rename local to avoid shadowing.
17201
9c4c5f81
PE
17202 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
17203 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
17204 * alloc.c (make_save_value): Integer argument is now of type
17205 ptrdiff_t, not int.
17206 (mark_object): Use ptrdiff_t, not int.
17207 * lisp.h (pD): New macro.
17208 * print.c (print_object): Use it.
17209
c0c5c8ae
PE
17210 * alloc.c: Use EMACS_INT, not int, to count objects.
17211 (total_conses, total_markers, total_symbols, total_vector_size)
17212 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
17213 (total_free_floats, total_floats, total_free_intervals)
17214 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
17215 Now EMACS_INT, not int. All uses changed.
17216 (Fgarbage_collect): Compute overall total using a double, so that
17217 integer overflow is less likely to be a problem. Check for overflow
17218 when converting back to an integer.
5a25e253
PE
17219 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
17220 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
17221 These were 'int' variables that could overflow on 64-bit hosts;
17222 they were never used, so remove them instead of repairing them.
211a0b2a 17223 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
17224 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
17225 Previously, this ceilinged at INT_MAX, but that doesn't work on
17226 64-bit machines.
e46bb31a 17227 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 17228
c78baabf 17229 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 17230 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
17231 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
17232 when a (possibly-narrower) signed value would do just as well.
17233 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 17234
c9d624c6
PE
17235 * alloc.c: Catch some string size overflows that we were missing.
17236 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
17237 for convenience in STRING_BYTES_MAX.
17238 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
17239 The definition here is exact; the one in lisp.h was approximate.
17240 (allocate_string_data): Check for string overflow. This catches
17241 some instances we weren't catching before. Also, it catches
17242 size_t overflow on (unusual) hosts where SIZE_MAX <= min
17243 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
17244 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 17245
c9d624c6
PE
17246 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
17247 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 17248 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 17249
353032ce
PE
17250 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
17251
2bccce07
PE
17252 * alloc.c (Fmake_string): Check for out-of-range init.
17253
0ac30604
SM
172542011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
17255
17256 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
17257
c195f2de
JD
172582011-06-14 Jan Djärv <jan.h.d@swipnet.se>
17259
17260 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
17261 xg_get_default_scrollbar_width.
17262
17263 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
17264 (int_gtk_range_get_value): Move to the scroll bar part of the file.
17265 (style_changed_cb): Call update_theme_scrollbar_width and call
17266 x_set_scroll_bar_default_width and xg_frame_set_char_size for
17267 all frames (Bug#8505).
17268 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
17269 Call gtk_window_set_resizable if HAVE_GTK3.
17270 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
17271 and height if HAVE_GTK3 (Bug#8505).
17272 (scroll_bar_width_for_theme): New variable.
17273 (update_theme_scrollbar_width): New function.
17274 (xg_get_default_scrollbar_width): Move code to
17275 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
17276 (xg_initialize): Call update_theme_scrollbar_width.
17277
17278 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
17279
17280 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
17281
e10ac9f1
MR
172822011-06-12 Martin Rudalics <rudalics@gmx.at>
17283
17284 * frame.c (make_frame): Call other_buffer_safely instead of
17285 other_buffer.
17286
17287 * window.c (temp_output_buffer_show): Call display_buffer with
17288 second argument Vtemp_buffer_show_specifiers and reset latter
17289 immediately after the call.
17290 (Vtemp_buffer_show_specifiers): New variable.
17291 (auto_window_vscroll_p, next_screen_context_lines)
17292 (Vscroll_preserve_screen_position): Remove leading asterisks from
17293 doc-strings.
17294
2d3c217e 172952011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 17296
7b7f97e8 17297 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
17298 * buffer.c (Qclone_number): Remove for now, as it's unused.
17299 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
17300 (record_buffer): Remove unused local.
17301 * frame.c (other_visible_frames, frame_buffer_list): Now static.
17302 (set_frame_buffer_list): Remove; unused.
17303 * frame.h (other_visible_frames): Remove decl.
17304 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
17305 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
17306 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
17307 if HAVE_GPM.
17308 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
17309 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
17310 Define only if HAVE_GPM.
17311 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
17312 (update_hints_inhibit): Remove; never set. All uses removed.
17313 * widgetprv.h (emacsFrameClassRec): Remove decl.
17314 * window.c (delete_deletable_window): Now returns void, since it
17315 wasn't returning anything.
17316 (compare_window_configurations): Remove unused locals.
17317 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
17318 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
17319 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
17320 the same widths as pointers. This follows up on the 2011-05-06 patch.
17321 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
17322 * xterm.h: Likewise.
17323 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
17324
1384b89e
JB
173252011-06-12 Juanma Barranquero <lekktu@gmail.com>
17326
17327 * makefile.w32-in: Update dependencies.
17328 (LISP_H): Add lib/intprops.h.
17329
1100a63c
CY
173302011-06-11 Chong Yidong <cyd@stupidchicken.com>
17331
17332 * image.c (gif_load): Add animation frame delay to the metadata.
17333 (syms_of_image): Use DEFSYM. New symbol `delay'.
17334
6198ccd0
MR
173352011-06-11 Martin Rudalics <rudalics@gmx.at>
17336
17337 * window.c (delete_deletable_window): Re-add.
17338 (Fset_window_configuration): Rewrite to handle dead buffers and
17339 consequently deletable windows.
17340 (window_tree, Fwindow_tree): Remove. Supply functionality in
17341 window.el.
17342 (compare_window_configurations): Simplify code.
17343
b6e3633c
AS
173442011-06-11 Andreas Schwab <schwab@linux-m68k.org>
17345
1ab0dee5
AS
17346 * image.c (imagemagick_load_image): Fix type mismatch.
17347 (Fimagemagick_types): Likewise.
17348
b6e3633c
AS
17349 * window.h (replace_buffer_in_windows): Declare.
17350
9397e56f
MR
173512011-06-11 Martin Rudalics <rudalics@gmx.at>
17352
17353 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
17354 Qclone_number. Remove external declaration of Qdelete_window.
17355 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
17356 code.
640c8776
SM
17357 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
17358 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
17359 (Fother_buffer): Rewrite doc-string. Major rewrite for new
17360 buffer list implementation.
17361 (other_buffer_safely): New function.
17362 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
17363 calls to replace_buffer_in_windows and
17364 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
17365 if allowed.
17366 (record_buffer): Inhibit quitting and rewrite using quittable
17367 functions. Run Qbuffer_list_update_hook if allowed.
17368 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
17369 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
17370 Move switch-to-buffer to window.el.
9397e56f
MR
17371 (bury-buffer): Move to window.el.
17372 (Vbuffer_list_update_hook): New variable.
17373
17374 * lisp.h (other_buffer_safely): Add prototype in buffer.c
17375 section.
17376
17377 * window.h (resize_frame_windows): Move up in code.
17378 (Fwindow_frame): Remove EXFUN.
17379 (replace_buffer_in_all_windows): Remove prototype.
17380 (replace_buffer_in_windows_safely): Add prototype.
17381
17382 * window.c: Declare Qdelete_window static again. Move down
17383 declaration of select_count.
17384 (Fnext_window, Fprevious_window): Rewrite doc-strings.
17385 (Fother_window): Move to window.el.
17386 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
17387 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
17388 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
17389 window.el.
17390 (replace_buffer_in_windows): Implement by calling
17391 Qreplace_buffer_in_windows.
17392 (replace_buffer_in_all_windows): Remove with some functionality
17393 moved into replace_buffer_in_windows_safely.
17394 (replace_buffer_in_windows_safely): New function.
17395 (select_window_norecord, select_frame_norecord): Move in front
17396 of run_window_configuration_change_hook. Remove now obsolete
17397 declarations.
640c8776
SM
17398 (Fset_window_buffer): Rewrite doc-string.
17399 Call Qrecord_window_buffer.
9397e56f
MR
17400 (keys_of_window): Move binding for other-window to window.el.
17401
b50691aa
CY
174022011-06-11 Chong Yidong <cyd@stupidchicken.com>
17403
17404 * dispextern.h (struct image): Replace data member, whose int_val
17405 and ptr_val fields were not used by anything, with a single
17406 lisp_val object.
17407
17408 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
17409 (gif_clear_image, gif_load, imagemagick_load_image)
17410 (gs_clear_image, gs_load): Callers changed.
17411
3f754b86
PE
174122011-06-10 Paul Eggert <eggert@cs.ucla.edu>
17413
cca69397
PE
17414 * buffer.h: Include <time.h>, for time_t.
17415 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
17416
109e28d0
PE
17417 Fix minor problems found by static checking.
17418
60737f02
PE
17419 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
17420
4b66faf3
PE
17421 Make identifiers static if they are not used in other modules.
17422 * data.c (Qcompiled_function, Qframe, Qvector):
17423 * image.c (QimageMagick, Qsvg):
17424 * minibuf.c (Qmetadata):
17425 * window.c (resize_window_check, resize_root_window): Now static.
17426 * window.h (resize_window_check, resize_root_window): Remove decls.
17427
109e28d0
PE
17428 * window.c (window_deletion_count, delete_deletable_window):
17429 Remove; unused.
46a4ce9e
PE
17430 (window_body_lines): Now static.
17431 (Fdelete_other_windows_internal): Mark vars as initialized.
17432 Make sure 'resize_failed' is initialized.
17433 (run_window_configuration_change_hook): Rename local to avoid shadowing.
17434 (resize_window_apply): Remove unused local.
17435 * window.h (delete_deletable_window): Remove decl.
17436
109e28d0 17437 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
17438 (imagemagick_load_image): Fix pointer signedness problem by changing
17439 last arg from unsigned char * to char *. All uses changed.
17440 Also, fix a local for similar reasons.
17441 Remove unused locals. Remove locals to avoid shadowing.
17442 (fn_rsvg_handle_free): Remove; unused.
17443 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 17444 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 17445
3f754b86
PE
17446 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
17447
2547adb1
CY
174482011-06-10 Chong Yidong <cyd@stupidchicken.com>
17449
17450 * image.c (gif_load): Fix omitted cast error introduced by
17451 2011-06-06 change.
17452
2c8e37d4
MR
174532011-06-10 Martin Rudalics <rudalics@gmx.at>
17454
17455 * window.h (resize_proportionally, orig_total_lines)
17456 (orig_top_line): Remove from window structure.
17457 (set_window_height, set_window_width, change_window_heights)
17458 (Fdelete_window): Remove prototypes.
17459 (resize_frame_windows): Remove duplicate declaration.
17460
440a42e3
EZ
174612011-06-10 Eli Zaretskii <eliz@gnu.org>
17462
17463 * window.h (resize_frame_windows, resize_window_check)
17464 (delete_deletable_window, resize_root_window)
17465 (resize_frame_windows): Declare prototypes.
17466
17467 * window.c (resize_window_apply): Make definition be "static" to
17468 match the prototype.
17469
562dd5e9
MR
174702011-06-10 Martin Rudalics <rudalics@gmx.at>
17471
17472 * window.c: Remove declarations of Qwindow_size_fixed,
17473 window_min_size_1, window_min_size_2, window_min_size,
17474 size_window, window_fixed_size_p, enlarge_window, delete_window.
17475 Remove static from declaration of Qdelete_window, it's
17476 temporarily needed by Fbury_buffer.
17477 (replace_window): Don't assign orig_top_line and
17478 orig_total_lines.
17479 (Fdelete_window, delete_window): Remove. Window deletion is
17480 handled by window.el.
640c8776
SM
17481 (window_loop): Remove DELETE_OTHER_WINDOWS case.
17482 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
17483 (Fdelete_other_windows): Remove. Deleting other windows is
17484 handled by window.el.
17485 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
17486 handled in window.el.
17487 (window_min_size_2, window_min_size_1, window_min_size): Remove.
17488 Window minimum sizes are handled in window.el.
17489 (shrink_windows, size_window, set_window_height)
17490 (set_window_width, change_window_heights, window_height)
17491 (window_width, CURBEG, CURSIZE, enlarge_window)
17492 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
17493 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
17494 handled in window.el.
17495 (make_dummy_parent): Rename to make_parent_window and give it a
17496 second argument horflag.
17497 (make_window): Don't set resize_proportionally any more.
17498 (Fsplit_window): Remove. Windows are split in window.el.
17499 (save_restore_action, save_restore_orig_size)
17500 (shrink_window_lowest_first, save_restore_orig_size): Remove.
17501 Resize mini windows in window.el.
17502 (grow_mini_window, shrink_mini_window): Implement by calling
17503 Qresize_root_window_vertically, resize_window_check and
17504 resize_window_apply.
640c8776
SM
17505 (saved_window, Fset_window_configuration, save_window_save):
17506 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
17507 resize_proportionally.
17508 (window_min_height, window_min_width): Move to window.el.
17509 (keys_of_window): Move bindings for delete-other-windows,
17510 split-window, delete-window and enlarge-window to window.el.
17511
17512 * buffer.c: Temporarily extern Qdelete_window.
17513 (Fbury_buffer): Temporarily call Qdelete_window instead of
17514 Fdelete_window (Fbury_buffer will move to window.el soon).
17515
17516 * frame.c (set_menu_bar_lines_1): Remove code handling
17517 orig_top_line and orig_total_lines.
17518
17519 * dispnew.c (adjust_frame_glyphs_initially): Don't use
17520 set_window_height but set heights directly.
17521 (change_frame_size_1): Use resize_frame_windows.
17522
17523 * xdisp.c (init_xdisp): Don't use set_window_height but set
17524 heights directly.
17525
640c8776
SM
17526 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
17527 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
17528 run_window_configuration_change_hook.
17529
17530 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
17531 instead of change_window_heights and run
17532 run_window_configuration_change_hook.
17533
1a13852e
MR
175342011-06-09 Martin Rudalics <rudalics@gmx.at>
17535
17536 * window.c (replace_window): Rename second argument REPLACEMENT to
17537 NEW. New third argument SETFLAG. Rewrite.
17538 (delete_window, make_dummy_parent): Call replace_window with
17539 third argument 1.
17540 (window_list_1): Move down in code.
17541 (run_window_configuration_change_hook): Move set_buffer part
17542 before select_frame_norecord part in order to unwind correctly.
17543 Rename count1 to count.
17544 (recombine_windows, delete_deletable_window, resize_root_window)
17545 (Fdelete_other_windows_internal)
17546 (Frun_window_configuration_change_hook, make_parent_window)
17547 (resize_window_check, resize_window_apply, Fresize_window_apply)
17548 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
17549 (Fdelete_window_internal, Fresize_mini_window_internal):
17550 New functions.
1a13852e
MR
17551 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
17552
f3d1777e
MR
175532011-06-08 Martin Rudalics <rudalics@gmx.at>
17554
496e208e
MR
17555 * window.h (window): Add some new members to window structure -
17556 normal_lines, normal_cols, new_total, new_normal, clone_number,
17557 splits, nest, prev_buffers, next_buffers.
17558 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 17559 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 17560
f3d1777e
MR
17561 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
17562 Remove.
496e208e
MR
17563 (make_dummy_parent): Set new members of windows structure.
17564 (make_window): Move down in code. Handle new members of window
17565 structure.
17566 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
17567 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
17568 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
17569 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
17570 (Fset_window_next_buffers, Fset_window_clone_number):
17571 New functions.
496e208e
MR
17572 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
17573 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
17574 Doc-string fixes.
17575 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
17576 Argument WINDOW can be now internal window too.
17577 (Fwindow_use_time): Move up in code.
17578 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
17579 Rewrite doc-string.
17580 (Fset_window_configuration, saved_window)
17581 (Fcurrent_window_configuration, save_window_save): Handle new
17582 members of window structure.
b9e809c2
MR
17583 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
17584 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
17585 (syms_of_window): New Lisp objects Qrecord_window_buffer,
17586 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
17587 Qget_mru_window, Qresize_root_window,
17588 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
17589 Qauto_buffer_name; staticpro them.
f3d1777e 17590
abde8f8c
MR
175912011-06-07 Martin Rudalics <rudalics@gmx.at>
17592
17593 * window.c (Fwindow_total_size, Fwindow_left_column)
17594 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
17595 (Fwindow_list_1): New functions.
17596 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
17597 (Fwindow_width, Fscroll_left, Fscroll_right):
17598 Use window_body_cols instead of window_box_text_cols.
17599 (delete_window, Fset_window_configuration):
17600 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
17601 (delete_all_subwindows): Take a window as argument and not a
17602 structure. Rewrite.
190b47e6
MR
17603 (window_loop): Remove handling of GET_LRU_WINDOW and
17604 GET_LARGEST_WINDOW.
17605 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
17606
17607 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
17608 window_box_text_cols. delete_all_subwindows now takes a
17609 Lisp_Object as argument.
abde8f8c 17610
640c8776
SM
17611 * indent.c (compute_motion, Fcompute_motion):
17612 Use window_body_cols instead of window_box_text_cols.
abde8f8c 17613
fa8a67e6
MR
17614 * frame.c (delete_frame): Call delete_all_subwindows with root
17615 window as argument.
17616
a54e3482
DC
176172011-06-07 Daniel Colascione <dan.colascione@gmail.com>
17618
17619 * fns.c (Fputhash): Document return value.
17620
60002bf5
CY
176212011-06-06 Chong Yidong <cyd@stupidchicken.com>
17622
17623 * image.c (gif_load): Implement gif89a spec "no disposal" method.
17624
0c671da6 176252011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 17626
b862a52a 17627 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 17628
be44ca6c
PE
17629 Check for overflow when converting integer to cons and back.
17630 * charset.c (Fdefine_charset_internal, Fdecode_char):
17631 Use cons_to_unsigned to catch overflow.
17632 (Fencode_char): Use INTEGER_TO_CONS.
17633 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
17634 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
17635 * data.c (long_to_cons, cons_to_long): Remove.
17636 (cons_to_unsigned, cons_to_signed): New functions.
17637 These signal an error for invalid or out-of-range values.
17638 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
17639 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
17640 * font.c (Ffont_variation_glyphs):
17641 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
17642 * lisp.h: Include <intprops.h>.
17643 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
17644 (cons_to_signed, cons_to_unsigned): New decls.
17645 (long_to_cons, cons_to_long): Remove decls.
17646 * undo.c (record_first_change): Use INTEGER_TO_CONS.
17647 (Fprimitive_undo): Use CONS_TO_INTEGER.
17648 * xfns.c (Fx_window_property): Likewise.
17649 * xselect.c: Include <limits.h>.
17650 (x_own_selection, selection_data_to_lisp_data):
17651 Use INTEGER_TO_CONS.
17652 (x_handle_selection_request, x_handle_selection_clear)
17653 (x_get_foreign_selection, Fx_disown_selection_internal)
17654 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
17655 (lisp_data_to_selection_data): Use cons_to_unsigned.
17656 (x_fill_property_data): Use cons_to_signed.
17657 Report values out of range.
17658
d1f3d2af
PE
17659 Check for buffer and string overflow more precisely.
17660 * buffer.h (BUF_BYTES_MAX): New macro.
17661 * lisp.h (STRING_BYTES_MAX): New macro.
17662 * alloc.c (Fmake_string):
17663 * character.c (string_escape_byte8):
17664 * coding.c (coding_alloc_by_realloc):
17665 * doprnt.c (doprnt):
17666 * editfns.c (Fformat):
17667 * eval.c (verror):
17668 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
17669 since they may not be the same number.
17670 * editfns.c (Finsert_char):
17671 * fileio.c (Finsert_file_contents):
17672 Likewise for BUF_BYTES_MAX.
17673
dd52fcea
PE
17674 * image.c: Use ptrdiff_t, not int, for sizes.
17675 (slurp_file): Switch from int to ptrdiff_t.
17676 All uses changed.
17677 (slurp_file): Check that file size fits in both size_t (for
17678 malloc) and ptrdiff_t (for sanity and safety).
17679
7f9bbdbb
PE
17680 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
17681 if b->modtime has its maximal value.
17682
dfe18f82
PE
17683 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
17684
84acfcf0
PE
17685 Don't assume time_t can fit into int.
17686 * buffer.h (struct buffer.modtime): Now time_t, not int.
17687 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
17688 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
17689
ccd9a01a
PE
17690 Minor fixes for signed vs unsigned integers.
17691 * character.h (MAYBE_UNIFY_CHAR):
17692 * charset.c (maybe_unify_char):
17693 * keyboard.c (read_char, reorder_modifiers):
17694 XINT -> XFASTINT, since the integer must be nonnegative.
17695 * ftfont.c (ftfont_spec_pattern):
17696 * keymap.c (access_keymap, silly_event_symbol_error):
17697 XUINT -> XFASTINT, since the integer must be nonnegative.
17698 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
17699 since it makes no difference and we prefer signed.
17700 * keyboard.c (record_char): Use XUINT when all the neighbors do.
17701 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
17702 nonnegative.
17703
d6d100dd
SM
177042011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
17705
17706 * window.h (Fwindow_frame): Declare.
17707
2b6148e4
PE
177082011-06-06 Paul Eggert <eggert@cs.ucla.edu>
17709
17710 * alloc.c: Simplify handling of large-request failures (Bug#8800).
17711 (SPARE_MEMORY): Always define.
17712 (LARGE_REQUEST): Remove.
17713 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
17714
f230ecc9
MR
177152011-06-06 Martin Rudalics <rudalics@gmx.at>
17716
727e958e
MR
17717 * lisp.h: Move EXFUNS for Fframe_root_window,
17718 Fframe_first_window and Fset_frame_selected_window to window.h.
17719
17720 * window.h: Move EXFUNS for Fframe_root_window,
17721 Fframe_first_window and Fset_frame_selected_window here from
17722 lisp.h.
17723
17724 * frame.c (Fwindow_frame, Fframe_first_window)
17725 (Fframe_root_window, Fframe_selected_window)
17726 (Fset_frame_selected_window): Move to window.c.
17727 (Factive_minibuffer_window): Move to minibuf.c.
17728 (Fother_visible_frames_p): New function.
17729
17730 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
17731
f230ecc9
MR
17732 * window.c (decode_window, decode_any_window): Move up in code.
17733 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
17734 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
17735 (Fwindow_buffer): Move up and rewrite doc-string.
17736 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
17737 (Fwindow_prev): New functions.
727e958e
MR
17738 (Fwindow_frame): Move here from frame.c. Accept any window as
17739 argument.
17740 (Fframe_root_window, Fframe_first_window)
17741 (Fframe_selected_window): Move here from frame.c. Accept frame
17742 or arbitrary window as argument. Update doc-strings.
17743 (Fminibuffer_window): Move up in code.
17744 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
17745 (Fset_frame_selected_window): Move here from frame.c.
17746 Marginal rewrite.
727e958e
MR
17747 (Fselected_window, select_window, Fselect_window): Move up in
17748 code. Minor doc-string fixes.
f230ecc9 17749
4d09bcf6
PE
177502011-06-06 Paul Eggert <eggert@cs.ucla.edu>
17751
17752 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
17753 Do not assume that spare memory exists; that assumption is valid
17754 only if SYSTEM_MALLOC.
17755 (LARGE_REQUEST): New macro, so that the issue of large requests
17756 is separated from the issue of spare memory.
17757
810928a2
AS
177582011-06-05 Andreas Schwab <schwab@linux-m68k.org>
17759
172418ad
AS
17760 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
17761 format. (Bug#8806)
17762
43f862f7
AS
17763 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
17764
810928a2
AS
17765 * xfns.c (x_set_scroll_bar_default_width): Move declarations
17766 before statements.
17767
a059fe24
JD
177682011-06-05 Jan Djärv <jan.h.d@swipnet.se>
17769
17770 * gtkutil.c (xg_get_default_scrollbar_width): New function.
17771
17772 * gtkutil.h: Declare xg_get_default_scrollbar_width.
17773
17774 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
17775 min width by calling x_set_scroll_bar_default_width (Bug#8505).
17776
989bf368
JB
177772011-06-05 Juanma Barranquero <lekktu@gmail.com>
17778
17779 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
17780
4b80f674
CY
177812011-06-04 Chong Yidong <cyd@stupidchicken.com>
17782
17783 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
17784 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
17785 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
17786 New error handlers.
4b80f674
CY
17787 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
17788 Obey Vx_select_enable_clipboard_manager. Catch errors in
17789 x_clipboard_manager_save (Bug#8779).
17790 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 17791 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 17792
99a33b77 177932011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
17794
17795 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
17796
99a33b77 177972011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
17798
17799 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
17800 in the current matrix if keep_current_p is non-zero.
17801
8264569d
EZ
178022011-06-04 Eli Zaretskii <eliz@gnu.org>
17803
17804 * bidi.c (bidi_level_of_next_char): Fix last change.
17805
57f97249
EZ
178062011-06-03 Eli Zaretskii <eliz@gnu.org>
17807
fec2107c 17808 Support bidi reordering of text covered by display properties.
57f97249 17809
fec2107c
EZ
17810 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
17811 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
17812 (bidi_cache_search, bidi_cache_iterator_state)
17813 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
17814 (bidi_level_of_next_char, bidi_move_to_visually_next):
17815 Support character positions inside a run of characters covered by a
fec2107c
EZ
17816 display string.
17817 (bidi_paragraph_init, bidi_resolve_explicit_1)
17818 (bidi_level_of_next_char): Call bidi_fetch_char and
17819 bidi_fetch_char_advance instead of FETCH_CHAR and
17820 FETCH_CHAR_ADVANCE.
17821 (bidi_init_it): Initialize new members.
17822 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
17823 definitions.
17824 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
17825 instead of using explicit *_CHAR codes.
d6d100dd
SM
17826 (bidi_resolve_explicit, bidi_resolve_weak):
17827 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
17828 bidirectional text is supported only in multibyte buffers.
17829 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
17830 it to initialize the frame_window_p member of struct bidi_it.
17831 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
17832 (bidi_resolve_explicit, bidi_resolve_weak)
17833 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
17834 bidi_it->nchars is non-positive.
17835 (bidi_level_of_next_char): Don't try to lookup the cache for the
17836 next/previous character if nothing is cached there yet, or if we
17837 were just reseat()'ed to a new position.
c40e2fb2 17838
0e14fe90
EZ
17839 * xdisp.c (set_cursor_from_row): Set start and stop points
17840 according to the row's direction when priming the loop that looks
17841 for the glyph on which to display cursor.
17842 (single_display_spec_intangible_p): Function deleted.
17843 (display_prop_intangible_p): Reimplement to call
17844 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
17845 Accept 3 additional arguments needed by handle_display_spec.
17846 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
17847 values: lists, `(when COND...)' forms, etc.
17848 (single_display_spec_string_p): Support property values that are
17849 lists with the argument STRING its top-level element.
17850 (display_prop_string_p): Fix the condition for processing a
17851 property that is a list to be consistent with handle_display_spec.
fec2107c 17852 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
17853 last portion of handle_display_prop.
17854 (compute_display_string_pos): Accept additional argument
17855 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
17856 value of a `display' property is a "replacing spec".
17857 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
17858 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
17859 the display property, but just return a value indicating whether
17860 the display property will replace the characters it covers.
17861 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
17862 frame_window_p members of struct bidi_it.
d6d100dd
SM
17863 (compute_display_string_pos, compute_display_string_end):
17864 New functions.
fec2107c
EZ
17865 (push_it): Accept second argument POSITION, where pop_it should
17866 jump to continue iteration.
17867 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 17868
fec2107c
EZ
17869 * keyboard.c (adjust_point_for_property): Adjust the call to
17870 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
17871
17872 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
17873 (bidi_init_it): Update prototypes.
17874 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
17875 (compute_display_string_pos, compute_display_string_end):
17876 Declare prototypes.
fec2107c
EZ
17877 (struct bidi_it): New members nchars and disp_pos. ch_len is now
17878 EMACS_INT.
fc6f18ce 17879
40087514 178802011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 17881
57f53182
PE
17882 Malloc failure behavior now depends on size of allocation.
17883 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
17884 * lisp.h: Change signatures accordingly.
17885 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
17886 All callers changed. (Bug#8762)
17887
17888 * gnutls.c: Use Emacs's memory allocators.
17889 Without this change, the gnutls library would invoke malloc etc.
17890 directly, which causes problems on non-SYNC_INPUT hosts, and which
17891 runs afoul of improving memory_full behavior. (Bug#8761)
17892 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
17893 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
17894 xfree instead of the default malloc, realloc, free.
17895 (Fgnutls_boot): No need to check for memory allocation failure,
17896 since xmalloc does that for us.
17897
ac32cd99 17898 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
17899 * category.c (hash_get_category_set):
17900 * ccl.c (ccl_driver):
17901 * charset.c (Fdefine_charset_internal):
17902 * charset.h (struct charset.hash_index):
17903 * composite.c (get_composition_id, gstring_lookup_cache)
17904 (composition_gstring_put_cache):
17905 * composite.h (struct composition.hash_index):
17906 * dispextern.h (struct image.hash):
17907 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
17908 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
17909 (hashfn_equal, hashfn_user_defined, make_hash_table)
17910 (maybe_resize_hash_table, hash_lookup, hash_put)
17911 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
17912 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
17913 (Fsxhash, Fgethash, Fputhash, Fmaphash):
17914 * image.c (make_image, search_image_cache, lookup_image)
17915 (xpm_put_color_table_h):
17916 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 17917 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 17918 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 17919 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
17920 * alloc.c (allocate_vectorlike):
17921 Check for overflow in vector size calculations.
17922 * ccl.c (ccl_driver):
17923 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
17924 * fns.c, image.c: Remove unnecessary static decls that would otherwise
17925 need to be updated by these changes.
40087514
PE
17926 * fns.c (make_hash_table, maybe_resize_hash_table):
17927 Check for integer overflow with large hash tables.
0de4bb68
PE
17928 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
17929 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
17930 (SXHASH_REDUCE): New macro.
17931 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
17932 Use it instead of discarding useful hash info with large hash values.
17933 (sxhash_float): New function.
17934 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
17935 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
17936 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
17937 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
17938 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
17939 Adjust signatures to match updated version of code.
17940 (consing_since_gc): Now EMACS_INT, since a single hash table can
17941 use more than INT_MAX bytes.
17942
698d32e2
DN
179432011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
17944
17945 Make it possible to build with GCC-4.6+ -O2 -flto.
17946
17947 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
17948
fd6fa53f
SM
179492011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
17950
17951 * minibuf.c (get_minibuffer, read_minibuf_unwind):
17952 Call minibuffer-inactive-mode.
17953
864db017
JB
179542011-05-31 Juanma Barranquero <lekktu@gmail.com>
17955
17956 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
17957 Update dependencies.
17958
2ad0baf4
DN
179592011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17960
17961 * data.c (init_data): Remove code for UTS, this system is not
17962 supported anymore.
17963
4fcc2638
DN
179642011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17965
17966 Don't force ./temacs to start in terminal mode.
17967
17968 * frame.c (make_initial_frame): Initialize faces in all cases, not
17969 only when CANNOT_DUMP is defined.
17970 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
17971
c56e0fd5
DN
179722011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17973
17974 * dispnew.c (add_window_display_history): Use const for the string
17975 pointer. Remove declaration, not needed.
17976
333d54da 179772011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 17978
55d4c1b2 17979 Use 'inline', not 'INLINE'.
333d54da 17980 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
17981 * alloc.c, fontset.c (INLINE): Remove.
17982 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
17983 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
17984 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
17985 * gmalloc.c (register_heapinfo): Use inline unconditionally.
17986 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
17987
738db178
DN
179882011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17989
17990 Make it possible to run ./temacs.
17991
17992 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
17993 syms_of_callproc does the same thing. Remove test for
17994 "initialized", do it in the caller.
17995 * emacs.c (main): Avoid calling set_initial_environment when dumping.
17996
620c53a6
SM
179972011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
17998
17999 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
18000 (read_minibuf): Use get_minibuffer.
18001 (syms_of_minibuf): Use DEFSYM.
18002 (Qmetadata): New var.
18003 * data.c (Qbuffer): Don't make it static.
18004 (syms_of_data): Use DEFSYM.
18005
e003a292
PE
180062011-05-31 Paul Eggert <eggert@cs.ucla.edu>
18007
18008 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
18009 (CCL_CODE_MIN): New macro.
18010
ed008a6d
PE
180112011-05-30 Paul Eggert <eggert@cs.ucla.edu>
18012
3687c2ef
PE
18013 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
18014
ed008a6d
PE
18015 * eval.c (Qdebug): Now static.
18016 * lisp.h (Qdebug): Remove decl. This reverts a part of the
18017 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
18018 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
18019
d66c4c7c
CY
180202011-05-29 Chong Yidong <cyd@stupidchicken.com>
18021
18022 * image.c: Various fixes to ImageMagick code comments.
18023 (Fimagemagick_types): Doc fix.
18024
5fbc2025
PE
180252011-05-29 Paul Eggert <eggert@cs.ucla.edu>
18026
0196f88a
PE
18027 Minor fixes prompted by GCC 4.6.0 warnings.
18028
18029 * xselect.c (converted_selections, conversion_fail_tag): Now static.
18030
5fbc2025
PE
18031 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
18032 (x_clipboard_manager_save_all): Move extern decl to ...
18033 * xterm.h: ... here, so that it can be checked for consistency.
18034
1dd3c2d9
CY
180352011-05-29 Chong Yidong <cyd@stupidchicken.com>
18036
18037 * xselect.c (x_clipboard_manager_save_frame)
18038 (x_clipboard_manager_save_all): New functions.
18039 (Fx_clipboard_manager_save): Lisp function deleted.
18040
18041 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
18042 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
18043
18044 * xterm.h: Update prototype.
18045
5ba6571d
WX
180462011-05-28 William Xu <william.xwl@gmail.com>
18047
18048 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
18049 exiting (Bug#8239).
18050
3eaff834
JM
180512011-05-28 Jim Meyering <meyering@redhat.com>
18052
e1900994 18053 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
18054 * fns.c (to_uchar): Define.
18055 (crypto_hash_function): Use it to convert some newly-signed
18056 variables to unsigned, to avoid sign-extension bugs. For example,
18057 without this change, (md5 "truc") would evaluate to
18058 45723a2aff78ff4fff7fff1114760e62 rather than the expected
18059 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 18060 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 18061
0f6990a7
PE
180622011-05-27 Paul Eggert <eggert@cs.ucla.edu>
18063
18064 Integer overflow fixes.
c8a9ca5a 18065
08686060
PE
18066 * dbusbind.c: Serial number integer overflow fixes.
18067 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
18068 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
18069 to hold a serial number that is too large for a fixnum.
18070 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18071 Check for serial numbers out of range. Decode any serial number
59568bf0 18072 that was so large that it became a float. (Bug#8722)
08686060 18073
2d1fc3c7
PE
18074 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
18075 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18076 Use XFASTINT rather than XUINT when numbers are nonnegative.
18077 (xd_append_arg, Fdbus_method_return_internal):
18078 (Fdbus_method_error_internal): Likewise. Also, for unsigned
18079 arguments, check that Lisp number is nonnegative, rather than
59568bf0 18080 silently wrapping negative numbers around. (Bug#8722)
30217ff0 18081 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 18082 (Bug#8722)
2d1fc3c7 18083
c8a9ca5a
PE
18084 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
18085
519e1d69
PE
18086 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
18087
6df6ae42 18088 ccl: Add integer overflow checks.
30569699
PE
18089 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
18090 (IN_INT_RANGE): New macros.
18091 (ccl_driver): Use them to check for integer overflow when
18092 decoding a CCL program. Many of the new checks are whether XINT (x)
18093 fits in int; it doesn't always, on 64-bit hosts. The new version
18094 doesn't catch all possible integer overflows, but it's an
847044ea 18095 improvement. (Bug#8719)
30569699 18096
c11285dc
PE
18097 * alloc.c (make_event_array): Use XINT, not XUINT.
18098 There's no need for unsigned here.
18099
fdccd48e
PE
18100 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
18101 This follows up to the 2011-05-06 change that substituted uintptr_t
18102 for EMACS_INT. This case wasn't caught back then.
18103
37910ab2
PE
18104 Rework Fformat to avoid integer overflow issues.
18105 * editfns.c: Include <float.h> unconditionally, as it's everywhere
18106 now (part of C89). Include <verify.h>.
18107 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
18108 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
18109 (Fformat): Avoid the prepass trying to compute sizes; it was only
18110 approximate and thus did not catch overflow reliably. Instead, walk
18111 through the format just once, formatting and computing sizes as we go,
18112 checking for integer overflow at every step, and allocating a larger
18113 buffer as needed. Keep track separately whether the format is
18114 multibyte. Keep only the most-recently calculated precision, rather
18115 than them all. Record whether each argument has been converted to
18116 string. Use EMACS_INT, not int, for byte and char and arg counts.
18117 Support field widths and precisions larger than INT_MAX. Avoid
18118 sprintf's undefined behavior with conversion specifications such as %#d
18119 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
18120 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
18121 formatting out-of-range floating point numbers with int
9173deec 18122 formats. (Bug#8668)
37910ab2 18123
2e6578fb
PE
18124 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
18125
0ae6bdee
PE
18126 * data.c: Avoid integer truncation in expressions involving floats.
18127 * data.c: Include <intprops.h>.
18128 (arith_driver): When there's an integer overflow in an expression
18129 involving floating point, convert the integers to floating point
18130 so that the resulting value does not suffer from catastrophic
18131 integer truncation. For example, on a 64-bit host (* 4
18132 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
18133 Do not rely on undefined behavior after integer overflow.
18134
de883a70
PE
18135 merge count_size_as_multibyte, parse_str_to_multibyte
18136 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 18137 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
18138 Check for integer overflow.
18139 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
18140 since it's now a duplicate of the other. This is more of
18141 a character than a buffer op, so better that it's in character.c.
18142 * fns.c, print.c: Adjust to above changes.
18143
2ff916cb
PE
181442011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
18145
18146 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
18147
f1b54466
PE
181482011-05-27 Paul Eggert <eggert@cs.ucla.edu>
18149
fb1ac845
PE
18150 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
18151 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
18152 (x_clipboard_manager_save): Now static.
18153 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
18154
f1b54466
PE
18155 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
18156 (crypto_hash_function): Now static.
18157 Fix pointer signedness problems. Avoid unnecessary initializations.
18158
a9f737ee
CY
181592011-05-27 Chong Yidong <cyd@stupidchicken.com>
18160
18161 * termhooks.h (Vselection_alist): Make it terminal-local.
18162
18163 * terminal.c (create_terminal): Initialize it.
18164
18165 * xselect.c: Support for clipboard managers.
18166 (Vselection_alist): Move to termhooks.h as terminal-local var.
18167 (LOCAL_SELECTION): New macro.
18168 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
18169 (symbol_to_x_atom): Remove gratuitous arg.
18170 (x_handle_selection_request, lisp_data_to_selection_data)
18171 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
18172 (x_own_selection, x_get_local_selection, x_convert_selection):
18173 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
18174 (some_frame_on_display): Delete unused function.
18175 (Fx_own_selection_internal, Fx_get_selection_internal)
18176 (Fx_disown_selection_internal, Fx_selection_owner_p)
18177 (Fx_selection_exists_p): New optional frame arg.
18178 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
18179 (x_handle_selection_clear): Don't treat other terminals with the
18180 same keyboard specially. Use the terminal-local Vselection_alist.
18181 (x_clear_frame_selections): Use Frun_hook_with_args.
18182
18183 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
18184
18185 * xterm.h: Add support for those atoms.
18186
e067f0c1
CY
181872011-05-26 Chong Yidong <cyd@stupidchicken.com>
18188
18189 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
18190 (converted_selections, conversion_fail_tag): New global variables.
18191 (x_selection_request_lisp_error): Free the above.
18192 (x_get_local_selection): Remove unnecessary code.
18193 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
18194 of converted selections stored in converted_selections.
18195 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
18196 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
18197 (x_convert_selection): New function.
18198 (x_handle_selection_event): Simplify.
18199 (x_get_foreign_selection): Don't ignore incoming requests while
18200 waiting for an answer; this will fail when we implement
18201 SAVE_TARGETS, and seems unnecessary anyway.
18202 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
18203 (Vx_sent_selection_functions): Doc fix.
18204
0f4aebc0
LL
182052011-05-26 Leo Liu <sdl.web@gmail.com>
18206
18207 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
18208
e61124cd
YM
182092011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18210
18211 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
18212
18213 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
18214 for fringe update if it has periodic bitmap.
ac389d0c 18215 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
18216 and fringe_bitmap_periodic_p.
18217
18218 * fringe.c (get_fringe_bitmap_data): New function.
18219 (draw_fringe_bitmap_1, update_window_fringes): Use it.
18220 (update_window_fringes): Record periodicity of fringe bitmap in glyph
18221 row. Mark glyph row for fringe update if periodicity changed.
18222
18223 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
18224 for fringe update unless it has periodic bitmap.
18225
f16d9837
KH
182262011-05-25 Kenichi Handa <handa@m17n.org>
18227
18228 * xdisp.c (get_next_display_element): Set correct it->face_id for
18229 a static composition.
18230
e1b90ef6
LL
182312011-05-24 Leo Liu <sdl.web@gmail.com>
18232
18233 * deps.mk (fns.o):
18234 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
18235
18236 * fns.c (crypto_hash_function, Fsha1): New function.
18237 (Fmd5): Use crypto_hash_function.
18238 (syms_of_fns): Add Ssha1.
18239
7400048f
PE
182402011-05-22 Paul Eggert <eggert@cs.ucla.edu>
18241
18242 * gnutls.c: Remove unused macros.
18243 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
18244 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
18245 Remove macros that are defined and never used.
18246 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
18247
abb71cf4
CY
182482011-05-22 Chong Yidong <cyd@stupidchicken.com>
18249
18250 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
18251 (Fx_get_selection_internal): Minor cleanup.
18252 (Fx_own_selection_internal): Rename arguments for consistency with
18253 select.el.
18254
6307db39
PE
182552011-05-22 Paul Eggert <eggert@cs.ucla.edu>
18256
18257 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
18258
f3d4e0a4
CY
182592011-05-22 Chong Yidong <cyd@stupidchicken.com>
18260
18261 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
18262
4d8ade89
YM
182632011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18264
18265 * dispnew.c (scrolling_window): Don't exclude the case that the
18266 last enabled row in the desired matrix touches the bottom boundary.
18267
32078c8d
GM
182682011-05-21 Glenn Morris <rgm@gnu.org>
18269
18270 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
18271 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
18272 and add some more files.
32078c8d 18273
7285dc67
EZ
182742011-05-20 Eli Zaretskii <eliz@gnu.org>
18275
18276 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
18277 report_file_error introduced by the change from 2011-05-07.
18278
89d1bd22
PE
182792011-05-20 Paul Eggert <eggert@cs.ucla.edu>
18280
18281 * systime.h (Time): Define only if emacs is defined.
18282 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
18283 where the include path doesn't have X11/X.h by default. See
18284 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
18285
cd394be1 182862011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
18287
18288 * composite.c (find_automatic_composition): Fix previous change.
18289
b9704ad9
GM
182902011-05-20 Glenn Morris <rgm@gnu.org>
18291
18292 * lisp.mk: New file, split from Makefile.in.
18293 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
18294 (shortlisp): Remove.
18295 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
18296
4a720484
GM
182972011-05-19 Glenn Morris <rgm@gnu.org>
18298
18299 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
18300 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
18301 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
18302 (lisp): Set the order to that of loadup.el.
18303 (shortlisp): Make it a copy of $lisp.
18304 (SOME_MACHINE_LISP): Remove.
18305 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
18306 Use just $shortlisp, not $SOME_MACHINE_LISP too.
18307
a28d4396
KH
183082011-05-18 Kenichi Handa <handa@m17n.org>
18309
18310 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
18311 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
18312 (find_automatic_composition): Mostly rewrite for efficiency.
18313
a2b1fa8e
JB
183142011-05-18 Juanma Barranquero <lekktu@gmail.com>
18315
18316 * makefile.w32-in: Update dependencies.
18317
8e1f5610
CS
183182011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
18319
18320 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 18321 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 18322
7025ee00 183232011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 18324
cdfa6eab
PE
18325 Fix some integer overflow issues, such as string length overflow.
18326
06d6db33
PE
18327 * insdel.c (count_size_as_multibyte): Check for string overflow.
18328
2b4560a8
PE
18329 * character.c (lisp_string_width): Check for string overflow.
18330 Use EMACS_INT, not int, for string indexes and lengths; in
18331 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
18332 the resulting string length overflows an EMACS_INT; instead,
18333 report a string overflow if no precision given. When checking for
18334 precision exhaustion, use a check that cannot possibly have
18335 integer overflow. (Bug#8675)
18336 * character.h (lisp_string_width): Adjust to new signature.
18337
cb93f9be
PE
18338 * alloc.c (string_overflow): New function.
18339 (Fmake_string): Use it. This doesn't change behavior, but saves
18340 a few bytes and will simplify future changes.
18341 * character.c (string_escape_byte8): Likewise.
18342 * lisp.h (string_overflow): New decl.
18343
1a1f3366
PE
18344 Fixups, following up to the user-interface timestamp change.
18345 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
18346 for UI timestamps, instead of unsigned long.
9fbd6841
PE
18347 * msdos.c (mouse_get_pos): Likewise.
18348 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
18349 * w32gui.h (Time): Define by including "systime.h" rather than by
18350 declaring it ourselves. (Bug#8664)
18351
d4e3e4d3
PE
18352 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
18353 * image.c (clear_image_cache): Likewise.
18354
f6a24d19
PE
18355 * term.c (term_mouse_position): Don't assume time_t wraparound.
18356
08dc5ae6
PE
18357 Be more systematic about user-interface timestamps.
18358 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
18359 and sometimes 'EMACS_UINT', to represent these timestamps.
18360 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
18361 This makes the code easier to follow, and makes it easier to catch
18362 integer overflow bugs such as Bug#8664.
18363 * frame.c (Fmouse_position, Fmouse_pixel_position):
18364 Use Time, not unsigned long, for user-interface timestamps.
18365 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
18366 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
18367 * keyboard.h (last_event_timestamp): Likewise.
18368 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
18369 * menu.h (xmenu_show): Likewise.
18370 * term.c (term_mouse_position): Likewise.
18371 * termhooks.h (struct input_event.timestamp): Likewise.
18372 (struct terminal.mouse_position_hook): Likewise.
18373 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
18374 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
18375 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
18376 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
18377 what it was before.
18378 * menu.h, termhooks.h: Include "systime.h", for Time.
18379
8e55734a
PE
18380 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
18381 Don't assume that the difference between two unsigned long values
18382 can fit into an integer. At this point, we know button_down_time
18383 <= event->timestamp, so the difference must be nonnegative, so
18384 there's no need to cast the result if double-click-time is
18385 nonnegative, as it should be; check that it's nonnegative, just in
18386 case. This bug is triggered when events are more than 2**31 ms
86db42d2 18387 apart (about 25 days). (Bug#8664)
8e55734a 18388
841f1b75 18389 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 18390 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 18391
3e26f69c
PE
18392 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
18393 that always fit in int. Use a sentinel instead of a counter, to
18394 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
18395 * frame.h (struct frame): Use int for menu_bar_items_used
18396 instead of EMACS_INT, since it always fits in int.
3e26f69c 18397
5cc152c0
PE
18398 * menu.c (grow_menu_items): Check for int overflow.
18399
d89eb65e
PE
18400 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
18401
5235bd3e
PE
18402 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
18403 Before, the code was not consistent. These values cannot exceed
18404 2**31 - 1 so there's no need to make them unsigned.
18405 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
18406 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
18407 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
18408 as modifiers.
18409 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
18410
bc827e23
PE
18411 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
18412 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
18413 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
18414 presumably because the widths might not match.
18415
78eb494e
PE
18416 * window.c (size_window): Avoid needless test at loop start.
18417
04f2d78b
CB
184182011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
18419
18420 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
18421
d2fc7e3d 184222011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
18423
18424 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
18425
d2fc7e3d 184262011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
18427
18428 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
18429 `width' to `bar_area_x' and `bar_area_width', respectively.
18430 (x_scroll_run): Take account of fringe background extension.
18431
04f2d78b
CB
18432 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
18433 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
18434 `bar_area_width', respectively.
18435 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
18436 background extension.
18437
79b70037
GM
184382011-05-10 Jim Meyering <meyering@redhat.com>
18439
18440 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
18441
2f142cc5
JB
184422011-05-10 Juanma Barranquero <lekktu@gmail.com>
18443
18444 * image.c (Finit_image_library): Return t for built-in image types,
18445 like pbm and xbm. (Bug#8640)
18446
57679c86
AS
184472011-05-09 Andreas Schwab <schwab@linux-m68k.org>
18448
18449 * w32menu.c (set_frame_menubar): Fix submenu allocation.
18450
888c9e86
EZ
184512011-05-07 Eli Zaretskii <eliz@gnu.org>
18452
b0512a1d
EZ
18453 * w32console.c (Fset_screen_color): Doc fix.
18454 (Fget_screen_color): New function.
18455 (syms_of_ntterm): Defsubr it.
18456
7285dc67
EZ
18457 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
18458 unlink the temporary file if Fcall_process didn't create it in the
18459 first place.
18460 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
18461 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
18462 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
18463 cue to call_process_cleanup not to close that handle.
18464
4d3fcc8e
BK
184652011-05-07 Ben Key <bkey76@gmail.com>
18466
18467 * makefile.w32-in: The bootstrap-temacs rule now makes use of
18468 one of two shell specific rules, either bootstrap-temacs-CMD or
18469 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
18470 to the previous implementation of the bootstrap-temacs rule.
18471 The bootstrap-temacs-CMD rule is similar to the previous
18472 implementation of the bootstrap-temacs rule except that it
18473 makes use of the ESC_CFLAGS variable instead of the CFLAGS
18474 variable.
18475
18476 These changes, along with some changes to nt/configure.bat,
18477 nt/gmake.defs, and nt/nmake.defs, are required to extend my
18478 earlier fix to add support for --cflags and --ldflags options
18479 that include quotes so that it works whether make uses cmd or
18480 sh as the shell.
18481
b4289b64
MA
184822011-05-06 Michael Albinus <michael.albinus@gmx.de>
18483
18484 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
18485 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
18486 is a constant.
18487 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
18488 a string. Handle both cases.
18489 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
18490 (Fdbus_register_method): Use Qinvalid_function.
18491
af4c0e28
JB
184922011-05-06 Juanma Barranquero <lekktu@gmail.com>
18493
18494 * makefile.w32-in: Update dependencies.
18495 (LISP_H): Add inttypes.h and stdin.h.
18496 (PROCESS_H): Add unistd.h.
18497
c51453d9
EZ
184982011-05-06 Eli Zaretskii <eliz@gnu.org>
18499
18500 * lread.c: Include limits.h (fixes the MS-Windows build broken by
18501 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
18502
8ff0ac3c 185032011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 18504
4c4b566b
PE
18505 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
18506
aab2b9b5
PE
18507 * term.c (vfatal): Remove stray call to va_end.
18508 It's not needed and the C Standard doesn't allow it here anyway.
18509
c378da0b
PE
18510 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
18511 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
18512
288b08c7
PE
18513 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
18514 bytes.
18515
e3601888
PE
18516 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
18517
db6c0e74
PE
18518 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
18519
dd5963ea
PE
18520 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
18521
88c9450f
PE
18522 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
18523
2f9442b8
PE
18524 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
18525
c032b5f8
PE
18526 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
18527 * charset.c (Fdefine_charset_internal): Don't initialize
18528 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 18529 32-bit int (Bug#8600).
a108c10b
PE
18530
18531 * lread.c (read_integer): Be more consistent with string-to-number.
18532 Use string_to_number to do the actual conversion; this avoids
18533 rounding errors and fixes some other screwups. Without this fix,
18534 for example, #x1fffffffffffffff was misread as -2305843009213693952.
18535 (digit_to_number): Move earlier, for benefit of read_integer.
18536 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 18537 not a digit in any supported base. (Bug#8602)
a108c10b 18538
ad5f9eea
PE
18539 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
18540
aec1708a
PE
18541 * dispnew.c (scrolling_window): Return 1 if we scrolled,
18542 to match comment at start of function. This also removes a
18543 GCC warning about overflow in a 32+64-bit port.
18544
47be4ab5
PE
18545 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
18546
371cac43
PE
18547 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
18548 Reported by Stefan Monnier in
18549 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
18550 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
18551 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 18552
d01a7826
PE
18553 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
18554 (EMACS_UINTPTR): Likewise, with uintptr_t.
18555
7fd47d5c
PE
18556 * lisp.h: Prefer 64-bit EMACS_INT if available.
18557 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
18558 on 32-bit hosts that have 64-bit int, so that they can access
18559 large files.
122b0c86
PE
18560 However, temporarily disable this change unless the temporary
18561 symbol WIDE_EMACS_INT is defined.
7fd47d5c 18562
8727937b
PE
18563 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
18564
8ac068ac
PE
18565 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
18566 This removes an assumption that EMACS_INT and long are the same
18567 width as pointers. The assumption is true for Emacs porting targets
18568 now, but we want to make other targets possible.
18569 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
18570 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
18571 In the rest of the code, change types of integers that hold casted
18572 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
18573 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
18574 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
18575 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
18576 No need to cast type when ORing.
18577 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
18578 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
18579 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
18580 assume EMACS_INT is the same width as char *.
18581 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
18582 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
18583 Remove no-longer-needed casts.
18584 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
18585 (xg_tool_bar_help_callback, xg_make_tool_item):
18586 Use EMACS_INTPTR to hold an integer
18587 that will be cast to void *; this can avoid a GCC warning
18588 if EMACS_INT is not the same width as void *.
18589 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
18590 * xdisp.c (display_echo_area_1, resize_mini_window_1):
18591 (current_message_1, set_message_1):
18592 Use a local to convert to proper width without a cast.
18593 * xmenu.c (dialog_selection_callback): Likewise.
18594
ede49d71
PE
18595 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
18596 Also, don't assume VALBITS / RAND_BITS is less than 5,
18597 and don't rely on undefined behavior when shifting a 1 left into
18598 the sign bit.
18599 * lisp.h (get_random): Change signature to match.
18600
2f30ecd0
PE
18601 * lread.c (hash_string): Use size_t, not int, for hash computation.
18602 Normally we prefer signed values; but hashing is special, because
18603 it's better to use unsigned division on hash table sizes so that
18604 the remainder is nonnegative. Also, size_t is the natural width
18605 for hashing into memory. The previous code used 'int', which doesn't
18606 retain enough info to hash well into very large tables.
18607 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
18608
2a866e7b
PE
18609 * dbusbind.c: Don't possibly lose pointer info when converting.
18610 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
18611 Use XPNTR rather than XHASH, so that the high-order bits of
18612 the pointer aren't lost when converting through void *.
18613
51639eac
PE
18614 * eval.c (Fautoload): Don't double-shift a pointer.
18615
92394119
PE
18616 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
18617
dbdb9a7c
JB
186182011-05-06 Juanma Barranquero <lekktu@gmail.com>
18619
18620 * gnutls.c (DEF_GNUTLS_FN):
18621 * image.c (DEF_IMGLIB_FN): Make function pointers static.
18622
db7a0b4f
AS
186232011-05-05 Andreas Schwab <schwab@linux-m68k.org>
18624
18625 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
18626 marker. (Bug#8610)
18627
cd394be1 186282011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
18629
18630 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
18631 New version that can reserve upto 2GB of heap space.
18632
f7ff1b0f 186332011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
18634
18635 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
18636
639c109b
TZ
186372011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
18638
18639 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
18640 `gnutls_certificate_set_x509_key_file'.
18641
d2127135
JB
186422011-05-05 Juanma Barranquero <lekktu@gmail.com>
18643
18644 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
18645 Update dependencies.
18646
e968f4f3
JB
186472011-05-04 Juanma Barranquero <lekktu@gmail.com>
18648
18649 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
18650 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
18651 Remove unused parameter `fildes'.
18652 * process.c (read_process_output, send_process): Don't pass it.
18653
84d358f0
JB
186542011-05-04 Juanma Barranquero <lekktu@gmail.com>
18655
18656 Fix previous change: the library cache is defined in w32.c.
18657 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
18658 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
18659
0898ca10
JB
186602011-05-04 Juanma Barranquero <lekktu@gmail.com>
18661
18662 Implement dynamic loading of GnuTLS on Windows.
18663
18664 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
18665 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
18666 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
18667 Declare.
18668
18669 * gnutls.c (Qgnutls_dll): Define.
18670 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
18671 (gnutls_*): Declare function pointers.
18672 (init_gnutls_functions): New function to initialize function pointers.
18673 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
18674 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
18675 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
18676 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
18677 (emacs_gnutls_write, emacs_gnutls_read)
18678 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
18679 (Fgnutls_available_p): New function.
18680 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
18681 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
18682 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
18683
18684 * image.c: Include w32.h.
18685 (Vimage_type_cache): Delete.
18686 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
18687 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
18688 (w32_delayed_load): Move to w32.c.
18689
18690 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
18691
18692 * w32.c (QCloaded_from, Vlibrary_cache): Define.
18693 (w32_delayed_load): Move from image.c. When loading a library, record
18694 its filename in the :loaded-from property of the library id.
18695 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
18696 Initialize and staticpro them.
18697 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
18698
18699 * process.c: Include lisp.h before w32.h, not after.
18700 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
18701 instead of gnutls_record_check_pending.
18702
18703 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
18704
ff4de4aa
TZ
187052011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
18706
18707 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
18708 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
18709 as passed in.
18710
abe95abb
JD
187112011-05-03 Jan Djärv <jan.h.d@swipnet.se>
18712
18713 * xterm.c (x_set_frame_alpha): Do not set property on anything
18714 else than FRAME_X_OUTER_WINDOW (Bug#8608).
18715
e16e55d4
JB
187162011-05-02 Juanma Barranquero <lekktu@gmail.com>
18717
18718 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
18719
bafcf6a5
JB
187202011-05-02 Juanma Barranquero <lekktu@gmail.com>
18721
18722 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
18723 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
18724 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
18725 (gnutls_global_initialized, Qgnutls_bootprop_priority)
18726 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
18727 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
18728 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
18729 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
18730 (Qgnutls_bootprop_callbacks_verify): Make static.
18731
e7a6747f
AS
187322011-05-01 Andreas Schwab <schwab@linux-m68k.org>
18733
19ed11ba
AS
18734 * callproc.c: Indentation fixup.
18735
e7a6747f 18736 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
18737 (wait_for_termination, interruptible_wait_for_termination):
18738 Move after wait_for_termination_1.
e7a6747f 18739
1ef14cb4
LMI
187402011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
18741
18742 * sysdep.c (interruptible_wait_for_termination): New function
18743 which is like wait_for_termination, but allows keyboard
18744 interruptions.
18745
18746 * callproc.c (Fcall_process): Add (:file "file") as an option for
18747 the STDOUT buffer.
18748 (Fcall_process_region): Ditto.
18749
330d880c
EZ
187502011-04-30 Eli Zaretskii <eliz@gnu.org>
18751
8db90b73
EZ
18752 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
18753 rather than `XVECTOR (FOO)->size'.
18754
330d880c
EZ
18755 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
18756 inttypes.h, as a gnulib replacement is used if it not available in
18757 system headers.
18758
15cbd324
EZ
187592011-04-21 Eli Zaretskii <eliz@gnu.org>
18760
18761 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
18762 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
18763 of MOST_POSITIVE_FIXNUM. (Bug#8528)
18764
18765 * coding.c (coding_alloc_by_realloc): Error out if destination
18766 will grow beyond MOST_POSITIVE_FIXNUM.
18767 (decode_coding_emacs_mule): Abort if there isn't enough place in
18768 charbuf for the composition carryover bytes. Reserve an extra
18769 space for up to 2 characters produced in a loop.
18770 (decode_coding_iso_2022): Abort if there isn't enough place in
18771 charbuf for the composition carryover bytes.
18772
187732011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 18774
ae940cca
EZ
18775 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
18776 aborting when %lld or %lll format is passed.
18777 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
18778 %llo or %llx format is passed. (Bug#8545)
18779
03ab8921
EZ
18780 * window.c (window_scroll_line_based): Use a marker instead of
18781 simple variables to record original value of point. (Bug#7952)
18782
afda1437
EZ
18783 * doprnt.c (doprnt): Fix the case where a multibyte sequence
18784 produced by %s or %c overflows available buffer space. (Bug#8545)
18785
f76dee0c
PE
187862011-04-28 Paul Eggert <eggert@cs.ucla.edu>
18787
18788 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 18789 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 18790
fdc5744d
JB
187912011-04-28 Juanma Barranquero <lekktu@gmail.com>
18792
18793 * w32.c (init_environment): Warn about defaulting HOME to C:\.
18794
638f053a
JB
187952011-04-28 Juanma Barranquero <lekktu@gmail.com>
18796
18797 * keyboard.c (Qdelayed_warnings_hook): Define.
18798 (command_loop_1): Run `delayed-warnings-hook'
18799 if Vdelayed_warnings_list is non-nil.
18800 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
18801 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
18802
d178f871
EZ
188032011-04-28 Eli Zaretskii <eliz@gnu.org>
18804
18805 * doprnt.c (doprnt): Don't return value smaller than the buffer
18806 size if the message was truncated. (Bug#8545).
18807
b124fd93
JB
188082011-04-28 Juanma Barranquero <lekktu@gmail.com>
18809
18810 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
18811 (Fx_window_property): #if-0 the whole functions, not just the bodies.
18812
e810457d
PE
188132011-04-27 Paul Eggert <eggert@cs.ucla.edu>
18814
18815 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
18816
ea51cceb
JB
188172011-04-27 Juanma Barranquero <lekktu@gmail.com>
18818
18819 * makefile.w32-in: Update dependencies.
18820
94dcfacf
EZ
188212011-04-27 Eli Zaretskii <eliz@gnu.org>
18822
18823 Improve `doprnt' and its usage. (Bug#8545)
18824 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
18825 `format_end'. Remove support for %l as a conversion specifier.
18826 Don't use xrealloc. Improve diagnostics when the %l size modifier
18827 is used. Update the commentary.
18828
18829 * eval.c (verror): Simplify calculation of size_t.
18830
18831 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
18832 messages.
18833
f61f41d7
PE
188342011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
18835
18836 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
18837 change.
18838
96fb4434
PE
188392011-04-27 Paul Eggert <eggert@cs.ucla.edu>
18840
18841 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
18842 This makes this file independent of the recent pseudovector change.
18843
671875da 188442011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 18845
69e9b5a3
PE
18846 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
18847
b5f869a7 18848 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 18849 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 18850 Remove unused local.
c8926152 18851 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 18852
841a1577 18853 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
18854 GCC 4.6.0 optimizes based on type-based alias analysis.
18855 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
18856 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
18857 != &v->size, and therefore "v->size = 1; b->size = 2; return
18858 v->size;" must therefore return 1. This assumption is incorrect
18859 for Emacs, since it type-puns struct Lisp_Vector * with many other
18860 types. To fix this problem, this patch adds a new type struct
f904488f 18861 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
18862 and pseudovectors, and helps optimizing compilers not get fooled
18863 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
18864 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
18865 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
18866 the size member.
eab3844f
PE
18867 (XSETPVECTYPE): Rewrite in terms of new macro.
18868 (XSETPVECTYPESIZE): New macro, specifying both type and size.
18869 This is a bit clearer, and further avoids the possibility of
18870 undesirable aliasing.
18871 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 18872 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
18873 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
18874 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
18875 (ASIZE): Now uses header.size rather than size.
18876 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
18877 to avoid the hassle of writing XVECTOR (foo)->header.size.
18878 (struct vectorlike_header): New type.
eab3844f
PE
18879 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
18880 object, to help avoid aliasing.
18881 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
18882 (SUBRP): Likewise, since Lisp_Subr is a special case.
18883 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
18884 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
18885 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 18886 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
18887 changed to be "header.size" and "header.next".
18888 * buffer.h (struct buffer): Likewise.
18889 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
18890 * frame.h (struct frame): Likewise.
18891 * process.h (struct Lisp_Process): Likewise.
18892 * termhooks.h (struct terminal): Likewise.
18893 * window.c (struct save_window_data, struct saved_window): Likewise.
18894 * window.h (struct window): Likewise.
18895 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
18896 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
18897 * buffer.c (init_buffer_once): Likewise.
18898 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
18899 special case.
18900 * process.c (Fformat_network_address): Use local var for size,
18901 for brevity.
18902
0df1eac5
PE
18903 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
18904
847ab9d1 18905 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
18906 * data.c (atof): Remove decl; no longer used or needed.
18907 (digit_to_number): Move to lread.c.
18908 (Fstring_to_number): Use new string_to_number function, to be
18909 consistent with how the Lisp reader treats infinities and NaNs.
18910 Do not assume that floating-point numbers represent EMACS_INT
18911 without losing information; this is not true on most 64-bit hosts.
18912 Avoid double-rounding errors, by insisting on integers when
18913 parsing non-base-10 numbers, as the documentation specifies.
18914 * lisp.h (string_to_number): New decl, replacing ...
18915 (isfloat_string): Remove.
bc0a5c13 18916 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 18917 (read1): Do not accept +. and -. as integers; this
452f4150
PE
18918 appears to have been a coding error. Similarly, do not accept
18919 strings like +-1e0 as floating point numbers. Do not report
18920 overflow for integer overflows unless the base is not 10 which
18921 means we have no simple and reliable way to continue.
18922 Break out the floating-point parsing into a new
18923 function string_to_number, so that Fstring_to_number parses
18924 floating point numbers consistently with the Lisp reader.
04f2d78b 18925 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
18926 (E_CHAR, EXP_INT): Remove, replacing with ...
18927 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
18928 (string_to_number): New function, replacing isfloat_string.
18929 This function checks for valid syntax and produces the resulting
18930 Lisp float number too. Rework it so that string-to-number
bc0a5c13 18931 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
18932 so that overflow for non-base-10 numbers is reported only when
18933 there's no portable and simple way to convert to floating point.
452f4150 18934
67769ffc
PE
18935 * textprop.c (set_text_properties_1): Rewrite for clarity,
18936 and to avoid GCC warning about integer overflow.
18937
c20db43f
PE
18938 * intervals.h (struct interval): Use EMACS_INT for members
18939 where EMACS_UINT might cause problems. See
18940 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
18941 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
18942 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
18943 All uses changed.
37aa2f85
PE
18944 (offset_intervals): Tell GCC not to worry about length overflow
18945 when negating a negative length.
c20db43f 18946
2538aa2f
PE
18947 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
18948 (overrun_check_free): Likewise.
18949
f2d3008d
PE
18950 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
18951 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
18952 word size.
18953
ec8df744
PE
18954 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
18955 (gnutls_make_error): Rename local to avoid shadowing.
18956 (gnutls_emacs_global_deinit): ifdef out; not used.
18957 (Fgnutls_boot): Use const for pointer to readonly storage.
18958 Comment out unused local. Fix pointer signedness problems.
18959
640ee02d
PE
18960 * lread.c (openp): Don't stuff size_t into an 'int'.
18961 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
18962 about possible signed overflow.
18963
6048fb2a
PE
18964 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
18965 (GDK_KEY_g): Don't define if already defined.
18966 (xg_prepare_tooltip): Avoid pointer signedness problem.
18967 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
18968
fa3c87e1
PE
18969 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
18970 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
18971
2172544b
PE
18972 * xfns.c (Fx_window_property): Simplify a bit,
18973 to make a bit faster and to avoid GCC 4.6.0 warning.
18974 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
18975
9b821a21
PE
18976 * fns.c (internal_equal): Don't assume size_t fits in int.
18977
3c616cfa
PE
18978 * alloc.c (compact_small_strings): Tighten assertion a little.
18979
c2982e87
PE
18980 Replace pEd with more-general pI, and fix some printf arg casts.
18981 * lisp.h (pI): New macro, generalizing old pEd macro to other
18982 conversion specifiers. For example, use "...%"pI"d..." rather
18983 than "...%"pEd"...".
18984 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 18985 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
18986 * alloc.c (check_pure_size): Don't overflow by converting size to int.
18987 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
18988 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
18989 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
18990 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
18991 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
18992 64-bit hosts.
18993 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
18994 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
18995 * print.c (safe_debug_print, print_object): Likewise.
18996 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
18997 to int.
6f04d126
PE
18998 Use pI instead of if-then-else-abort. Use %p to avoid casts,
18999 avoiding the 0 flag, which is not portable.
c2982e87
PE
19000 * process.c (Fmake_network_process): Use pI to avoid cast.
19001 * region-cache.c (pp_cache): Likewise.
19002 * xdisp.c (decode_mode_spec): Likewise.
19003 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
19004 behavior on 64-bit hosts with printf arg.
6f04d126 19005 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
19006 (x_stop_queuing_selection_requests): Likewise.
19007 (x_get_window_property): Don't truncate byte count to an 'int'
19008 when tracing.
0b432f21 19009
5e073ec7
PE
19010 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
19011 here, since it parses constructs like leading '-' and spaces,
19012 which are not wanted; and it overflows with large numbers.
19013 Instead, simply match F[0-9]+, which is what is wanted anyway.
19014
36372bf9
PE
19015 * alloc.c: Remove unportable assumptions about struct layout.
19016 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
19017 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
19018 (allocate_vectorlike, make_pure_vector): Use the new macros,
19019 plus offsetof, to remove unportable assumptions about struct layout.
19020 These assumptions hold on all porting targets that I know of, but
19021 they are not guaranteed, they're easy to remove, and removing them
19022 makes further changes easier.
19023
0b432f21
PE
19024 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
19025 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
19026 (string_overrun_cookie): Now const. Use initializers that
19027 don't formally overflow signed char, to avoid warnings.
000098c1
PE
19028 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
19029 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
19030 (allocate_buffer): Don't assume sizeof (struct buffer) is a
19031 multiple of sizeof (EMACS_INT); it need not be, if
19032 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 19033 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 19034
895009e1
JB
190352011-04-26 Juanma Barranquero <lekktu@gmail.com>
19036
19037 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
19038
6a7a1b0b
TZ
190392011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
19040
19041 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 19042 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
19043 Reported by Paul Eggert <eggert@cs.ucla.edu>.
19044
841a1577 190452011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
19046
19047 * lisp.h (Qdebug): List symbol.
895009e1 19048 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
19049 * keyboard.c (debug-on-event): New variable.
19050 (handle_user_signal): Break into debugger when debug-on-event
19051 matches the current signal symbol.
19052
f2d3ba6f
DN
190532011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
19054
19055 * alloc.c (check_sblock, check_string_bytes)
19056 (check_string_free_list): Convert to standard C.
19057
42ce4c63
TZ
190582011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
19059
19060 * w32.c (emacs_gnutls_push): Fix typo.
19061
825cd63c
EZ
190622011-04-25 Eli Zaretskii <eliz@gnu.org>
19063
fb11d64d
EZ
19064 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
19065 "cast to pointer from integer of different size".
19066
825cd63c
EZ
19067 Improve doprnt and its use in verror. (Bug#8545)
19068 * doprnt.c (doprnt): Document the set of format control sequences
19069 supported by the function. Use SAFE_ALLOCA instead of always
19070 using `alloca'.
19071
19072 * eval.c (verror): Don't limit the buffer size at size_max-1, that
19073 is one byte too soon. Don't use xrealloc; instead xfree and
19074 xmalloc anew.
19075
e061a11b
TZ
190762011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
19077
19078 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
19079 callbacks stage.
19080
19081 * gnutls.c: Renamed global_initialized to
19082 gnutls_global_initialized. Added internals for the
19083 :verify-hostname-error, :verify-error, and :verify-flags
19084 parameters of `gnutls-boot' and documented those parameters in the
19085 docstring. Start callback support.
9173deec
JB
19086 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
19087 unless a fatal error occurred. Call gnutls_alert_send_appropriate
19088 on error. Return error code.
e061a11b
TZ
19089 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
19090 (emacs_gnutls_read): Likewise.
19091 (Fgnutls_boot): Return handshake error code.
19092 (emacs_gnutls_handle_error): New function.
19093 (wsaerror_to_errno): Likewise.
19094
19095 * w32.h (emacs_gnutls_pull): Add prototype.
19096 (emacs_gnutls_push): Likewise.
19097
19098 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
19099 (emacs_gnutls_push): Likewise.
19100
191012011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
19102
19103 * process.c (wait_reading_process_output): Check if GnuTLS
19104 buffered some data internally if no FDs are set for TLS
19105 connections.
19106
19107 * makefile.w32-in (OBJ2): Add gnutls.$(O).
19108 (LIBS): Link to USER_LIBS.
19109 ($(BLD)/gnutls.$(0)): New target.
19110
fa6996bc
EZ
191112011-04-24 Eli Zaretskii <eliz@gnu.org>
19112
eb35682e
EZ
19113 * xdisp.c (handle_single_display_spec): Rename the
19114 display_replaced_before_p argument into display_replaced_p, to
19115 make it consistent with the commentary. Fix typos in the
19116 commentary.
19117
e2ad650c
EZ
19118 * textprop.c (syms_of_textprop): Remove dead code.
19119 (copy_text_properties): Delete obsolete commentary about an
19120 interface that was deleted long ago. Fix typos in the description
19121 of arguments.
19122
1b2de274
EZ
19123 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
19124 to changes in oldXMenu/XMenu.h from 2011-04-16.
19125 <menu_help_message, prev_menu_help_message>: Constify.
19126 (IT_menu_make_room): menu->help_text is now `const char **';
19127 adjust.
19128
19129 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
19130 to changes in oldXMenu/XMenu.h from 2011-04-16.
19131 (struct XMenu): Declare `help_text' `const char **'.
19132
19133 * xfaces.c <Qunspecified>: Make extern again.
19134
19135 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 19136 required by POSIX.
1b2de274 19137
762b15be
EZ
19138 * doc.c (get_doc_string): Improve the format passed to `error'.
19139
19140 * doprnt.c (doprnt): Improve commentary.
19141
19142 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
19143
19144 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
19145 them with etags.
19146
f1052e5d
EZ
19147 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
19148 changes in globals.h immediately force recompilation.
762b15be
EZ
19149 (TAGS): Depend on $(CURDIR)/m/intel386.h and
19150 $(CURDIR)/s/ms-w32.h.
19151 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 19152
fa6996bc
EZ
19153 * character.c (Fchar_direction): Function deleted.
19154 (syms_of_character): Don't defsubr it.
19155 <char-direction-table>: Deleted.
19156
e6c3da20
EZ
191572011-04-23 Eli Zaretskii <eliz@gnu.org>
19158
19159 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
19160 * doprnt.c: Include limits.h.
19161 (SIZE_MAX): New macro.
04f2d78b
CB
19162 (doprnt): Return a size_t value. 2nd arg is now size_t.
19163 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
19164 Improve overflow protection. Support `l' modifier for integer
19165 conversions. Support %l conversion. Don't assume an EMACS_INT
19166 argument for integer conversions and for %c.
19167
19168 * lisp.h (doprnt): Restore prototype.
19169
19170 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
19171 $(SRC)/character.h.
19172
19173 * Makefile.in (base_obj): Add back doprnt.o.
19174
19175 * deps.mk (doprnt.o): Add back prerequisites.
19176 (callint.o): Depend on character.h.
19177
19178 * eval.c (internal_lisp_condition_case): Include the handler
19179 representation in the error message.
19180 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
19181 when breaking from the loop.
19182
19183 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
19184
19185 * callint.c (Fcall_interactively): When displaying error message
19186 about invalid control letter, pass the character's codepoint, not
19187 a pointer to its multibyte form. Improve display of the character
19188 in octal and display also its hex code.
19189
19190 * character.c (char_string): Use %x to display the (unsigned)
19191 codepoint of an invalid character, to avoid displaying a bogus
19192 negative value.
19193
19194 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
19195 `error', not SYMBOL_NAME itself.
19196
19197 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
19198 character arguments to `error'.
19199
19200 * charset.c (check_iso_charset_parameter): Fix incorrect argument
19201 to `error' in error message about FINAL_CHAR argument. Make sure
19202 FINAL_CHAR is a character, and use %c when it is passed as
19203 argument to `error'.
19204
4ffd0d6b 192052011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
19206
19207 * s/ms-w32.h (localtime): Redirect to sys_localtime.
19208
19209 * w32.c: Include <time.h>.
19210 (sys_localtime): New function.
19211
4ffd0d6b 192122011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
19213
19214 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
19215
4ffd0d6b 19216 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 19217
4ffd0d6b 192182011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 19219
4ffd0d6b
GM
19220 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
19221 zombies (Bug#8467).
aac0c6e3 19222
04c56954
EZ
192232011-04-19 Eli Zaretskii <eliz@gnu.org>
19224
19225 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
19226 gl_state.e_property when gl_state.object is Qt.
19227
19228 * insdel.c (make_gap_larger): Remove limitation of buffer size
19229 to <= INT_MAX.
19230
16a43933
CY
192312011-04-18 Chong Yidong <cyd@stupidchicken.com>
19232
19233 * xdisp.c (lookup_glyphless_char_display)
19234 (produce_glyphless_glyph): Handle cons cell entry in
19235 glyphless-char-display.
19236 (Vglyphless_char_display): Document it.
19237
19238 * term.c (produce_glyphless_glyph): Handle cons cell entry in
19239 glyphless-char-display.
19240
4581706e
CY
192412011-04-17 Chong Yidong <cyd@stupidchicken.com>
19242
19243 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
19244
19245 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
19246
19247 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
19248 definition for no-X builds.
19249
4887c6e2 192502011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 19251
fd35b6f9
PE
19252 Static checks with GCC 4.6.0 and non-default toolkits.
19253
5c1ccb01
PE
19254 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
19255
006c5daa
PE
19256 * process.c (keyboard_bit_set): Define only if SIGIO.
19257 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
19258 (send_process): Repair possible setjmp clobbering.
19259
efc736d3
PE
19260 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
19261
4e2fe2e6
PE
19262 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
19263
f97334a2
PE
19264 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
19265
4e75f29d
PE
19266 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
19267 Define only if needed.
19268
90efadd1
PE
19269 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
19270 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 19271 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 19272
3c647824
PE
19273 * dispextern.h (struct redisplay_interface): Rename param
19274 to avoid shadowing.
e264f262 19275 * termhooks.h (struct terminal): Likewise.
761383f4 19276 * xterm.c (xembed_send_message): Likewise.
3c647824 19277
b58c5c4a
PE
19278 * insdel.c (make_gap_smaller): Define only if
19279 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
19280
cad59032
PE
19281 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
19282 it.
19283
c339dc2e
PE
19284 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
19285 so that we aren't warned about unused symbols.
19286
91a3e27b
PE
19287 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
19288
399c71d3 19289 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 19290
8ffc96f5
PE
19291 * xfns.c (x_real_positions): Mark locals as initialized.
19292
eef9bc79
PE
19293 * xmenu.c (xmenu_show): Don't use uninitialized vars.
19294
098db9dd
PE
19295 * xterm.c: Fix problems found by static analysis with other toolkits.
19296 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
19297 (x_dispatch_event): Declare static if USE_GTK, and
19298 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 19299 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 19300 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
19301 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
19302 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 19303
eb18f6cc
PE
19304 * xmenu.c (menu_help_callback): Pointer type fixes.
19305 Use const pointers when pointing at readonly data. Avoid pointer
19306 signedness clashes.
19307 (FALSE): Remove unused macro.
19308 (update_frame_menubar): Remove unused decl.
19309
1fe72bf8
PE
19310 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
19311
60d9e1db
PE
19312 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
19313 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
19314 (single_menu_item): Rename local to avoid shadowing.
19315
39261c26
PE
19316 * keyboard.c (make_lispy_event): Remove unused local var.
19317
018c5e19
PE
19318 * frame.c, frame.h (x_get_resource_string): Bring this back, but
19319 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
19320
63d2b86e
PE
19321 * bitmaps: Change bitmaps from unsigned char back to the X11
19322 compatible char. Avoid the old compiler warnings about
19323 out-of-range initializers by using, for example, '\xab' rather
19324 than 0xab.
19325
aefd87e1
PE
19326 * xgselect.c (xgselect_initialize): Check vs interface
19327 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
19328
bf501fb9
PE
19329 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
19330
e9829fdf
PE
19331 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
19332 to read-only memory.
19333
1086c095
PE
19334 * fns.c (vector): Remove; this old hack is no longer needed.
19335
2baccd04 19336 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 19337 Remove unused var.
dde42981 19338 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 19339
72391843 19340 * xrdb.c (x_load_resources): Omit unused local.
3565b346 19341
436c16df 19342 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 19343 (x_window): Rename locals to avoid shadowing.
dc5ddd85 19344 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 19345
92bb796d 19346 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 19347 (x_term_init): Remove local to avoid shadowing.
92bb796d 19348
764430a3 19349 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
19350
19351 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
19352 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
19353
d1dfb56c
EZ
193542011-04-16 Eli Zaretskii <eliz@gnu.org>
19355
c4354cb4
EZ
19356 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
19357
d1dfb56c
EZ
19358 Fix regex.c, syntax.c and friends for buffers > 2GB.
19359 * syntax.h (struct gl_state_s): Declare character position members
19360 EMACS_INT.
19361
19362 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
19363
04f2d78b
CB
19364 * textprop.c (verify_interval_modification, interval_of):
19365 Declare arguments EMACS_INT.
d1dfb56c
EZ
19366
19367 * intervals.c (adjust_intervals_for_insertion): Declare arguments
19368 EMACS_INT.
19369
19370 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
19371
19372 * indent.c (Fvertical_motion): Local variable it_start is now
19373 EMACS_INT.
19374
19375 * regex.c (re_match, re_match_2, re_match_2_internal)
19376 (bcmp_translate, regcomp, regexec, print_double_string)
19377 (group_in_compile_stack, re_search, re_search_2, regex_compile)
19378 (re_compile_pattern, re_exec): Declare arguments and local
19379 variables `size_t' and `ssize_t' and return values `regoff_t', as
19380 appropriate.
19381 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
19382 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
19383 <compile_stack_type>: `size' and `avail' are now `size_t'.
19384
19385 * regex.h <regoff_t>: Use ssize_t, not int.
19386 (re_search, re_search_2, re_match, re_match_2): Arguments that
19387 specify buffer/string position and length are now ssize_t and
19388 size_t. Return type is regoff_t.
19389
613052cd
BK
193902011-04-16 Ben Key <bkey76@gmail.com>
19391
19392 * nsfont.m: Fixed bugs in ns_get_family and
19393 ns_descriptor_to_entity that were caused by using free to
19394 deallocate memory blocks that were allocated by xmalloc (via
19395 xstrdup). This caused Emacs to crash when compiled with
19396 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
19397 --enable-checking=xmallocoverrun). xfree is now used to
19398 deallocate these memory blocks.
19399
4170f62f 194002011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 19401
71b41406
PE
19402 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
19403
9587a89d
PE
19404 emacs_write: Accept and return EMACS_INT for sizes.
19405 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
19406 et seq.
19407 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
19408 Accept and return EMACS_INT.
19409 (emacs_gnutls_write): Return the number of bytes written on
19410 partial writes.
19411 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
19412 (emacs_read, emacs_write): Remove check for negative size, as the
19413 Emacs source code has been audited now.
9587a89d
PE
19414 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
19415 (emacs_read, emacs_write): Use it.
273a5f82
PE
19416 * process.c (send_process): Adjust to the new signatures of
19417 emacs_write and emacs_gnutls_write. Do not attempt to store
19418 a byte offset into an 'int'; it might overflow.
9587a89d 19419 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 19420
3e047f51
PE
19421 * sound.c: Don't assume sizes fit in 'int'.
19422 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 19423 Return EMACS_INT, not int.
3e047f51 19424 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
19425 Accept EMACS_INT, not int.
19426 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
19427 record read return values.
19428
cc39a9db
BK
194292011-04-15 Ben Key <bkey76@gmail.com>
19430
c9d0ec6d
JB
19431 * keyboard.c (Qundefined): Don't declare static since it is used
19432 in nsfns.m.
19433 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
19434 static since they are used in nsfont.m.
cc39a9db 19435
6c60eb9f
SM
194362011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
19437
19438 * process.c (Qprocessp): Don't declare static.
19439 * lisp.h (Qprocessp): Declare again.
19440
7990b61a
JB
194412011-04-15 Juanma Barranquero <lekktu@gmail.com>
19442
19443 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
19444
5d4cb038
PE
194452011-04-14 Paul Eggert <eggert@cs.ucla.edu>
19446
8bd7b830 19447 Improve C-level modularity by making more things 'static'.
cd64ea1d 19448
e3b27b31
PE
19449 Don't publish debugger-only interfaces to other modules.
19450 * lisp.h (safe_debug_print, debug_output_compilation_hack):
19451 (verify_bytepos, count_markers): Move decls to the only modules
19452 that need them.
19453 * region-cache.h (pp_cache): Likewise.
19454 * window.h (check_all_windows): Likewise.
19455 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
19456
5d4cb038
PE
19457 * sysdep.c (croak): Now static, if
19458 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
19459 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
19460
19461 * alloc.c (refill_memory_reserve): Now static if
19462 !defined REL_ALLOC || defined SYSTEM_MALLOC.
19463 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 19464
e87b6180
PE
19465 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
19466 Define only if USE_LUCID.
19467
ac64929e
PE
19468 * xrdb.c (x_customization_string, x_rm_string): Now static.
19469
6f37259d
PE
19470 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
19471 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
19472
1683e3ab
PE
19473 * xdisp.c (draw_row_with_mouse_face): Now static.
19474 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
19475
de9c2632
PE
19476 * window.h (check_all_windows): Mark externally visible.
19477
2b96acb7
PE
19478 * window.c (window_deletion_count): Now static.
19479
19480 * undo.c: Make symbols static if they're not exported.
19481 (last_undo_buffer, last_boundary_position, pending_boundary):
19482 Now static.
19483
50436f33
PE
19484 * textprop.c (interval_insert_behind_hooks): Now static.
19485 (interval_insert_in_front_hooks): Likewise.
19486
64520e5c
PE
19487 * term.c: Make symbols static if they're not exported.
19488 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
19489 (max_frame_lines, tty_set_terminal_modes):
19490 (tty_reset_terminal_modes, tty_turn_off_highlight):
19491 (get_tty_terminal): Now static.
19492 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
19493 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 19494 HAVE_WINDOW_SYSTEM.
64520e5c
PE
19495 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
19496 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
19497
1fa53021
PE
19498 * sysdep.c: Make symbols static if they're not exported.
19499 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
19500 Now static.
19501 (sigprocmask_set, full_mask): Remove; unused.
19502 (wait_debugging): Mark as visible.
19503 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
19504 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
19505
d4b43b22
PE
19506 * syntax.c (syntax_temp): Define only if !__GNUC__.
19507
b7c513d0
PE
19508 * sound.c (current_sound_device, current_sound): Now static.
19509
989b29ad
PE
19510 * search.c (searchbufs, searchbuf_head): Now static.
19511
13a55a78
PE
19512 * scroll.c (scroll_cost): Remove; unused.
19513 * dispextern.h (scroll_cost): Remove decl.
19514
de68a1fc
PE
19515 * region-cache.h (pp_cache): Mark as externally visible.
19516
40ccffa6
PE
19517 * process.c: Make symbols static if they're not exported.
19518 (process_tick, update_tick, create_process, chan_process):
19519 (Vprocess_alist, proc_buffered_char, datagram_access):
19520 (fd_callback_data, send_process_frame, process_sent_to): Now static.
19521 (deactivate_process): Mark defn as static, as well as decl.
19522 * lisp.h (create_process): Remove decl.
19523 * process.h (chan_process, Vprocess_alist): Remove decls.
19524
ad64fc97
PE
19525 * print.c: Make symbols static if they're not exported.
19526 (print_depth, new_backquote_output, being_printed, print_buffer):
19527 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
19528 (print_interval, print_number_index, initial_stderr_stream):
19529 Now static.
19530 * lisp.h (Fprinc): Remove decl.
19531 (debug_output_compilation_hack): Mark as externally visible.
19532
adddb265
PE
19533 * sysdep.c (croak): Move decl from here to syssignal.h.
19534 * syssignal.h (croak): Put it here, so the API can be checked when
19535 'croak' is called from dissociate_if_controlling_tty.
19536
1717ede2
PE
19537 * minibuf.c: Make symbols static if they're not exported.
19538 (minibuf_save_list, choose_minibuf_frame): Now static.
19539 * lisp.h (choose_minibuf_frame): Remove decl.
19540
fa5fb2bc
PE
19541 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
19542
1e3890d1
PE
19543 * lread.c: Make symbols static if they're not exported.
19544 (read_objects, initial_obarray, oblookup_last_bucket_number):
19545 Now static.
19546 (make_symbol): Remove; unused.
19547 * lisp.h (initial_obarray, make_symbol): Remove decls.
19548
8a1414fa
PE
19549 * keyboard.c: Make symbols static if they're not exported.
19550 (single_kboard, recent_keys_index, total_keys, recent_keys):
19551 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
19552 (this_single_command_key_start, echoing, last_auto_save):
19553 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
19554 (command_loop, echo_now, keyboard_init_hook, help_char_p):
19555 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
19556 (Vlispy_mouse_stem, double_click_count):
19557 Now static.
19558 (force_auto_save_soon): Define only if SIGDANGER.
19559 (ignore_mouse_drag_p): Now static if
19560 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
19561 (print_help): Remove; unused.
19562 (stop_character, last_timer_event): Mark as externally visible.
19563 * keyboard.h (ignore_mouse_drag_p): Declare only if
19564 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
19565 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
19566 * lisp.h (echoing): Remove decl.
19567 (force_auto_save_soon): Declare only if SIGDANGER.
19568 * xdisp.c (redisplay_window): Simplify code, to make it more
19569 obvious that ignore_mouse_drag_p is not accessed if !defined
19570 USE_GTK && !defined HAVE_NS.
19571
93ea6e8f
PE
19572 * intervals.c: Make symbols static if they're not exported.
19573 (merge_properties_sticky, merge_interval_right, delete_interval):
19574 Now static.
19575 * intervals.h (merge_interval_right, delete_interval): Remove decls.
19576
77382fcc
PE
19577 * insdel.c: Make symbols static if they're not exported.
19578 However, leave prepare_to_modify_buffer alone. It's never
19579 called from outside this function, but that appears to be a bug.
19580 (combine_after_change_list, combine_after_change_buffer):
4889fc82 19581 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
19582 (adjust_after_replace_noundo): Remove; unused.
19583 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 19584 (signal_before_change): Remove decls.
77382fcc 19585
9306c32e
PE
19586 * indent.c (val_compute_motion, val_vmotion): Now static.
19587
cd44d2eb
PE
19588 * image.c: Make symbols static if they're not exported.
19589 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
19590 if USE_GTK.
19591 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
19592 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
19593
ad9a7a06
PE
19594 * fringe.c (standard_bitmaps): Now static.
19595 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
19596
81626931
PE
19597 * frame.c: Make symbols static if they're not exported.
19598 (x_report_frame_params, make_terminal_frame): Now static.
19599 (get_frame_param): Now static, unless HAVE_NS.
19600 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
19601 (x_get_resource_string): Remove; not used.
19602 * frame.h (make_terminal_frame, x_report_frame_params):
19603 (x_get_resource_string); Remove decls.
19604 (x_fullscreen_adjust): Declare only if WINDOWSNT.
19605 * lisp.h (get_frame_param): Declare only if HAVE_NS.
19606
239f9db9
PE
19607 * font.c, fontset.c: Make symbols static if they're not exported.
19608 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
19609 (FACE_SUITABLE_FOR_CHAR_P): Use it.
19610 * font.c (font_close_object): Now static.
19611 * font.h (font_close_object): Remove.
19612 * fontset.c (FONTSET_OBJLIST): Remove.
19613 (free_realized_fontset) #if-0 the body, which does nothing.
19614 (face_suitable_for_char_p): #if-0, as it's never called.
19615 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
19616 * xfaces.c (face_at_string_position):
19617 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
19618 since 0 is always ASCII.
19619
dfcf3579
PE
19620 * fns.c (weak_hash_tables): Now static.
19621
5045092b
PE
19622 * fileio.c: Make symbols static if they're not exported.
19623 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
19624 (Vwrite_region_annotation_buffers): Now static.
19625
57a96f5c
PE
19626 * eval.c: Make symbols static if they're not exported.
19627 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
19628 * lisp.h (backtrace_list): Remove decl.
19629
35f08c38
PE
19630 * emacs.c: Make symbols static if they're not exported.
19631 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
19632 (fatal_error_code, fatal_error_signal_hook, standard_args):
19633 Now static.
19634 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
19635 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
19636 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
19637 * lisp.h (fatal_error_signal_hook): Remove decl.
19638 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
19639
f44bd759
PE
19640 * editfns.c: Move a (normally-unused) function to its only use.
19641 * editfns.c, lisp.h (get_operating_system_release): Remove.
19642 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
19643 worth the hassle of breaking this out.
19644
b532497d
PE
19645 * xterm.c: Make symbols static if they're not exported.
19646 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
19647 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
19648 (x_destroy_window, x_delete_display):
19649 Now static.
19650 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
19651 (x_mouse_leave): Remove; unused.
19652 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
19653 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
19654 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
19655 Remove decls.
19656 (x_mouse_leave): Declare only if WINDOWSNT.
19657 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
19658 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
19659 USE_X_TOOLKIT.
19660
1675728f
PE
19661 * ftxfont.c: Make symbols static if they're not exported.
19662 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
19663 HAVE_FREETYPE.
19664 * font.h (ftxfont_driver): Likewise.
19665
e4cebfca
PE
19666 * xfns.c: Make symbols static if they're not exported.
19667 (x_last_font_name, x_display_info_for_name):
19668 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
19669 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
19670 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
19671 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
19672 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
19673 (last_show_tip_args): Now static.
19674 (xic_defaut_fontset, xic_create_fontsetname): Define only if
19675 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
19676 (x_screen_planes): Remove; unused.
19677 * dispextern.h (x_screen_planes): Remove decl.
19678
5bf46f05
PE
19679 * dispnew.c: Make symbols static if they're not exported.
19680 * dispextern.h (redraw_garbaged_frames, scrolling):
19681 (increment_row_positions): Remove.
19682 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
19683 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
19684 Now static.
19685 (redraw_garbaged_frames): Remove; unused.
19686
435f4c28
PE
19687 * xfaces.c: Make symbols static if they're not exported.
19688 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
19689 Remove decls.
19690 * xterm.h (defined_color): Remove decls.
19691 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
19692 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
19693 (menu_face_changed_default, defined_color, free_realized_face):
19694 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
19695 (ascii_face_of_lisp_face): Remove; unused.
19696
8524aef3
PE
19697 * xdisp.c: Make symbols static if they're not exported.
19698 * dispextern.h (scratch_glyph_row, window_box_edges):
19699 (glyph_to_pixel_coords, set_cursor_from_row):
19700 (get_next_display_element, set_iterator_to_next):
19701 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
19702 (show_mouse_face): Remove decls
19703 * frame.h (message_buf_print): Likewise.
19704 * lisp.h (pop_message, set_message, check_point_in_composition):
19705 Likewise.
19706 * xterm.h (set_vertical_scroll_bar): Likewise.
19707 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
19708 (message_buf_print, scratch_glyph_row, displayed_buffer):
19709 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
19710 (get_next_display_element, show_mouse_face, window_box_edges):
19711 (frame_to_window_pixel_xy, check_point_in_composition):
19712 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
19713 (glyph_to_pixel_coords): Remove; unused.
19714
16390cd2
PE
19715 * dired.c (file_name_completion): Now static.
19716
19717 * dbusbind.c (xd_in_read_queued_messages): Now static.
19718
a25f4dfa
PE
19719 * lisp.h (circular_list_error, FOREACH): Remove; unused.
19720 * data.c (circular_list_error): Remove.
19721
14a9c8df
PE
19722 * commands.h (last_point_position, last_point_position_buffer):
19723 (last_point_position_window): Remove decls.
19724 * keyboard.c: Make these variables static.
19725
04f2d78b
CB
19726 * coding.h (coding, code_convert_region, encode_coding_gap):
19727 Remove decls.
74ab6df5
PE
19728 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
19729 (iso_code_class, detect_coding, code_convert_region): Now static.
19730 (encode_coding_gap): Remove; unused.
19731
38dfbee1
PE
19732 * chartab.c (chartab_chars, chartab_bits): Now static.
19733
a2cb4e63
PE
19734 * charset.h (charset_iso_8859_1): Remove decl.
19735 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
19736 Now static.
19737
127198fd
PE
19738 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
19739 * ccl.c (Vccl_program_table): Now static.
19740 (check_ccl_update): Remove; unused.
19741
d85b608f
PE
19742 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
19743 * category.h: ... from here.
19744 * category.c (check_category_table, set_category_set): Now static.
19745
31cd66f3
PE
19746 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
19747 * lisp.h: Remove these decls.
19748
c358e587
PE
19749 * buffer.c (buffer_count): Remove unused var.
19750
e78aecca
PE
19751 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
19752 so that it's not optimized away.
19753 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
19754 * dispextern.h (bidi_dump_cached_states): Remove, since it's
19755 exported only to the debugger.
19756
e192d7d3 19757 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 19758 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 19759
92470028
PE
19760 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
19761 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
19762 was inaccessible from Lisp.
19763 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
19764 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
19765
244ed907
PE
19766 alloc.c: Import and export fewer symbols, and remove unused items.
19767 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
19768 is defined.
19769 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
19770 it's not optimized away by whole-program optimization.
19771 (message_enable_multibyte, free_misc): Remove.
19772 (catchlist, handlerlist, mark_backtrace):
19773 Declare only if BYTE_MARK_STACK.
19774 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
19775 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
19776 (message_enable_multibyte): Remove decl.
19777 (free_misc, interval_free_list, float_block, float_block_index):
19778 (n_float_blocks, float_free_list, cons_block, cons_block_index):
19779 (cons_free_list, last_marked_index):
19780 Now static.
19781 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
19782 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
19783 (mark_backtrace): Define only if BYTE_MARK_STACK.
19784 * xdisp.c (message_enable_multibyte): Now static.
19785
61c2b50e 19786 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
19787 This makes it easier for human readers (and static analyzers)
19788 to see whether these variables are used from other modules.
19789 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
19790 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
19791 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
19792 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
19793 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
19794 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
19795 * xmenu.c, xselect.c:
19796 Declare Q* vars static if they are not used in other modules.
19797 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
19798 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
19799 Remove decls of unexported vars.
19800 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
19801
95c82688
PE
19802 * lisp.h (DEFINE_FUNC): Make sname 'static'.
19803
16a97296
PE
19804 Make Emacs functions such as Fatom 'static' by default.
19805 This makes it easier for human readers (and static analyzers)
19806 to see whether these functions can be called from other modules.
19807 DEFUN now defines a static function. To make the function external
19808 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
19809 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
19810 (Finit_image_library):
16a97296
PE
19811 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
19812 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
19813 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
19814 Remove decls, since these functions are now static.
19815 (Funintern, Fget_internal_run_time): New decls, since these functions
19816 were already external.
95c82688 19817
16a97296
PE
19818 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
19819 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
19820 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
19821 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
19822 * keyboard.c, keymap.c, lread.c:
19823 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
19824 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
19825 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
19826 Mark functions with DEFUE instead of DEFUN,
19827 if they are used in other modules.
19828 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
19829 decls for now-static functions.
19830 * buffer.h (Fdelete_overlay): Remove decl.
19831 * callproc.c (Fgetenv_internal): Mark as internal.
19832 * composite.c (Fremove_list_of_text_properties): Remove decl.
19833 (Fcomposition_get_gstring): New forward static decl.
19834 * composite.h (Fcomposite_get_gstring): Remove decl.
19835 * dired.c (Ffile_attributes): New forward static decl.
19836 * doc.c (Fdocumntation_property): New forward static decl.
19837 * eval.c (Ffetch_bytecode): New forward static decl.
19838 (Funintern): Remove extern decl; now in .h file where it belongs.
19839 * fileio.c (Fmake_symbolic_link): New forward static decl.
19840 * image.c (Finit_image_library): New forward static decl.
19841 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
19842 * intervals.h (Fprevious_property_change):
19843 (Fremove_list_of_text_properties): Remove decls.
19844 * keyboard.c (Fthis_command_keys): Remove decl.
19845 (Fcommand_execute): New forward static decl.
19846 * keymap.c (Flookup_key): New forward static decl.
19847 (Fcopy_keymap): Now static.
19848 * keymap.h (Flookup_key): Remove decl.
19849 * process.c (Fget_process): New forward static decl.
19850 (Fprocess_datagram_address): Mark as internal.
19851 * syntax.c (Fsyntax_table_p): New forward static decl.
19852 (skip_chars): Remove duplicate decl.
19853 * textprop.c (Fprevious_property_change): New forward static decl.
19854 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
19855 Now internal.
19856 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
19857 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
19858
785bbd42
PE
19859 * editfns.c (Fformat): Remove unreachable code.
19860
8b913b57
AS
198612011-04-14 Andreas Schwab <schwab@linux-m68k.org>
19862
19863 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
19864 change. (Bug#8496)
19865
a6744a35
EZ
198662011-04-13 Eli Zaretskii <eliz@gnu.org>
19867
19868 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
19869 when at ZV. (Bug#8487)
19870
e7974947
AS
198712011-04-12 Andreas Schwab <schwab@linux-m68k.org>
19872
baad03f0
AS
19873 * charset.c (Fclear_charset_maps): Use xfree instead of free.
19874 (Bug#8437)
19875 * keyboard.c (parse_tool_bar_item): Likewise.
19876 * sound.c (sound_cleanup, alsa_close): Likewise.
19877 * termcap.c (tgetent): Likewise.
19878 * xfns.c (x_default_font_parameter): Likewise.
19879 * xsettings.c (read_and_apply_settings): Likewise.
19880
e7974947
AS
19881 * alloc.c (overrun_check_malloc, overrun_check_realloc)
19882 (overrun_check_free): Protoize.
19883
28272684
PE
198842011-04-12 Paul Eggert <eggert@cs.ucla.edu>
19885
19886 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
19887 since callers should never pass a negative size.
19888 Change the signature to match that of plain 'read' and 'write'; see
19889 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
19890 * lisp.h: Update prototypes of emacs_write and emacs_read.
19891
11997c76
EZ
198922011-04-11 Eli Zaretskii <eliz@gnu.org>
19893
19894 * xdisp.c (redisplay_window): Don't try to determine the character
19895 position of the scroll margin if the window start point w->startp
e896f03c 19896 is outside the buffer's accessible region. (Bug#8468)
11997c76 19897
8a2cbd72
EZ
198982011-04-10 Eli Zaretskii <eliz@gnu.org>
19899
19900 Fix write-region and its subroutines for buffers > 2GB.
19901 * fileio.c (a_write, e_write): Modify declaration of arguments and
19902 local variables to support buffers larger than 2GB.
19903 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
19904
19905 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
19906 argument, local variables, and return value.
19907
19908 * lisp.h: Update prototypes of emacs_write and emacs_read.
19909
19910 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
19911
4073e537 199122011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 19913
1ebfdcb6
PE
19914 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
19915
b2ded58d
PE
19916 Fix more problems found by GCC 4.6.0's static checks.
19917
7d66342c
PE
19918 * xdisp.c (vmessage): Use a better test for character truncation.
19919
bbf47d44
PE
19920 * charset.c (load_charset_map): <, not <=, for optimization,
19921 and to avoid potential problems with integer overflow.
9248994d 19922 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 19923 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 19924 * editfns.c (Fformat): Likewise.
1e69125e 19925 * syntax.c (skip_chars): Likewise.
3befa583 19926
e3019616
PE
19927 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
19928 This also lets GCC 4.6.0 generate slightly better loop code.
19929
becfa255
PE
19930 * callint.c (Fcall_interactively): <, not <=, for optimization.
19931 (Fcall_interactively): Count the number of arguments produced,
19932 not the number of arguments given. This is simpler and lets GCC
19933 4.6.0 generate slightly better code.
19934
dae0cd48
PE
19935 * ftfont.c: Distingish more carefully between FcChar8 and char.
19936 The previous code passed unsigned char * to a functions like
19937 strlen and xstrcasecmp that expect char *, which does not
19938 conform to the C standard.
19939 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
19940 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
19941 char * when the C standard requires it.
19942
76032d70
PE
19943 * keyboard.c (read_char): Remove unused var.
19944
eb3f1cc8
PE
19945 * eval.c: Port to Windows vsnprintf (Bug#8435).
19946 Include <limits.h>.
19947 (SIZE_MAX): Define if the headers do not.
19948 (verror): Do not give up if vsnprintf returns a negative count.
19949 Instead, grow the buffer. This ports to Windows vsnprintf, which
19950 does not conform to C99. Problem reported by Eli Zaretskii.
19951 Also, simplify the allocation scheme, by avoiding the need for
19952 calling realloc, and removing the ALLOCATED variable.
19953
70476b54
PE
19954 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
19955
12020a9e
PE
19956 Remove invocations of doprnt, as Emacs now uses vsnprintf.
19957 But keep the doprint source code for now, as we might revamp it
19958 and use it again (Bug#8435).
ea6c7ae6
PE
19959 * lisp.h (doprnt): Remove.
19960 * Makefile.in (base_obj): Remove doprnt.o.
19961 * deps.mk (doprnt.o): Remove.
19962
5fdb398c
PE
19963 error: Print 32- and 64-bit integers portably (Bug#8435).
19964 Without this change, on typical 64-bit hosts error ("...%d...", N)
19965 was used to print both 32- and 64-bit integers N, which relied on
19966 undefined behavior.
61bdb816 19967 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
19968 * lisp.h (error, verror): Mark as printf-like functions.
19969 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
19970 Report overflow in size calculations when allocating printf buffer.
19971 Do not truncate output string at its first null byte.
19972 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
19973 Truncate the output at a character boundary, since vsnprintf does not
19974 do that.
19975 * charset.c (check_iso_charset_parameter): Convert internal
19976 character to string before calling 'error', since %c now has the
19977 printf meaning.
19978 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
19979 overflow when computing char to be passed to 'error'. Do not
19980 pass Lisp_Object to 'error'; pass the integer instead.
19981 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
19982 formatted with plain %d.
19983
b189fa66
PE
19984 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
19985
bff87ef0
PE
19986 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
19987
7e2cac20
PE
19988 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
19989
ce4d90b5
PE
19990 * xterm.c (x_catch_errors): Remove duplicate declaration.
19991
266c9547
PE
19992 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
19993
79c49ad2
PE
19994 * xdisp.c, lisp.h (message_nolog): Remove; unused.
19995
368f4090
JM
199962011-04-10 Jim Meyering <meyering@redhat.com>
19997
19998 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
19999 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
20000 return ssize_t not "int", and use size_t as the buffer length.
20001 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
20002 * gnutls.h: Update declarations.
20003 * process.c (read_process_output): Use ssize_t, to match.
20004 (send_process): Likewise.
20005
a32d4040
CY
200062011-04-09 Chong Yidong <cyd@stupidchicken.com>
20007
20008 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
20009
8546720e 200102011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 20011
04f2d78b
CB
20012 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
20013 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 20014
8546720e
GM
20015 * xterm.c (handle_one_xevent):
20016 * xmenu.c (create_and_show_popup_menu):
20017 * xselect.c (x_decline_selection_request)
20018 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 20019
0a2f5c1a 200202011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
20021
20022 Fix some uses of `int' instead of EMACS_INT.
20023 * search.c (string_match_1, fast_string_match)
20024 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
20025 (scan_buffer, find_next_newline_no_quit)
20026 (find_before_next_newline, search_command, Freplace_match)
20027 (Fmatch_data): Make some `int' variables be EMACS_INT.
20028
20029 * xdisp.c (display_count_lines): 3rd argument and return value now
20030 EMACS_INT. All callers changed.
20031 (pint2hrstr): Last argument is now EMACS_INT.
20032
20033 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
20034 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
20035 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
20036 (decode_coding_utf_16, decode_coding_emacs_mule)
20037 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
20038 (decode_coding_ccl, decode_coding_charset)
20039 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
20040 (decode_coding_iso_2022, decode_coding_emacs_mule)
20041 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
20042 <char_offset, last_offset>: Declare EMACS_INT.
20043 (encode_coding_utf_8, encode_coding_utf_16)
20044 (encode_coding_emacs_mule, encode_invocation_designation)
20045 (encode_designation_at_bol, encode_coding_iso_2022)
20046 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
20047 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
20048 Declare EMACS_INT.
20049 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
20050 (encode_invocation_designation): Last argument P_NCHARS is now
20051 EMACS_INT.
20052 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
20053 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
20054
20055 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
20056 All users changed.
20057
20058 * ccl.c (Fccl_execute_on_string): Declare some variables
20059 EMACS_INT.
20060
8546720e 200612011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
20062
20063 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
20064
4e19a977
CS
200652011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
20066
20067 * process.c (Fformat_network_address): Doc fix.
20068
87302331
R
200692011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
20070
ee7683eb 20071 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 20072
cbb59342
CY
200732011-04-08 Chong Yidong <cyd@stupidchicken.com>
20074
20075 * keyboard.c (read_char): Call Lisp function help-form-show,
20076 instead of using internal_with_output_to_temp_buffer.
20077 (Qhelp_form_show): New var.
e0d38eeb 20078 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
20079
20080 * print.c (internal_with_output_to_temp_buffer): Function deleted.
20081
20082 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
20083
e67a13ab
CY
200842011-04-06 Chong Yidong <cyd@stupidchicken.com>
20085
04f2d78b
CB
20086 * process.c (Flist_processes): Remove to Lisp.
20087 (list_processes_1): Delete.
e67a13ab 20088
973f782d
EZ
200892011-04-06 Eli Zaretskii <eliz@gnu.org>
20090
7c106b1e
EZ
20091 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
20092
973f782d
EZ
20093 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
20094
41cf7d1a 200952011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 20096
ca23cc88
PE
20097 Fix more problems found by GCC 4.6.0's static checks.
20098
f390e2d5
PE
20099 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
20100
42eea0d0
PE
20101 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
20102
b69769da 20103 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 20104
f9541e84
PE
20105 * xdisp.c (vmessage): Mark as a printf-like function.
20106
13841b55
PE
20107 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
20108
c136c10f
PE
20109 * sound.c (sound_warning): Don't crash if arg contains a printf format.
20110
5e2d4a30
PE
20111 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
20112 printf-like functions.
20113 (tiff_load): Add casts to remove these marks before passing them
20114 to system-supplied API.
20115
583f48b9
PE
20116 * eval.c (Fsignal): Remove excess argument to 'fatal'.
20117
b25d760e
PE
20118 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
20119 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
20120 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
20121 directly, rather than having caller test rule sign. This avoids
20122 some unnecessary tests.
20123 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
20124 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
20125 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 20126
bc7b6697 20127 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 20128 (xfont_open): Avoid unnecessary tests.
bc7b6697 20129
27ccc379
PE
20130 * composite.c (composition_gstring_put_cache): Use unsigned integer.
20131
dcd5c89a
PE
20132 * composite.h, composite.c (composition_gstring_put_cache):
20133 Use EMACS_INT, not int, for length.
20134
b13a45c6
PE
20135 * composite.h (COMPOSITION_DECODE_REFS): New macro,
20136 breaking out part of COMPOSITION_DECODE_RULE.
20137 (COMPOSITION_DECODE_RULE): Use it.
20138 * composite.c (get_composition_id): Remove unused local vars,
20139 by using the new macro.
20140
1e792e4d
PE
20141 * textprop.c (set_text_properties_1): Change while to do-while,
20142 since the condition is always true at first.
20143
dc6c6455 20144 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
20145 (interval_deletion_adjustment): Return unsigned value.
20146 All uses changed.
dc6c6455 20147
aba7731a
PE
20148 * process.c (list_processes_1, create_pty, read_process_output):
20149 (exec_sentinel): Remove vars that were set but not used.
afd4052b 20150 (create_pty): Remove unnecessary "volatile"s.
bc57d757 20151 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 20152 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 20153 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 20154
fdfc4bf3
PE
20155 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
20156
fca8fe46 20157 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 20158 (update_syntax_table): Use unsigned instead of int.
fca8fe46 20159
06a0259a 20160 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 20161 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 20162 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 20163
e7b9e80f
PE
20164 * print.c (print_error_message): Avoid int overflow.
20165
56201685
PE
20166 * font.c (font_list_entities): Redo for clarity,
20167 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
20168
78834453 20169 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 20170 (font_score): Avoid potential overflow in diff calculation.
78834453 20171
0bc0b309 20172 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 20173 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 20174
e610eaca
PE
20175 * eval.c (funcall_lambda): Rename local to avoid shadowing.
20176
b895abce
PE
20177 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
20178 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
20179 can always succeed if overflow has undefined behavior.
20180
1f1d9321 20181 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 20182 (wordify): Omit three unnecessary tests.
1f1d9321 20183
c59478bc
PE
20184 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
20185 All callers changed. This avoids the need for an unused var.
20186
79b73827
PE
20187 * casefiddle.c (casify_region): Remove var that is set but not used.
20188
a4db5dfe
PE
20189 * dired.c (file_name_completion): Remove var that is set but not used.
20190
43aae36e
PE
20191 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
20192
2a47c44d 20193 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 20194 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 20195
a37c69bf
PE
20196 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
20197 Check for integer overflow on size calculations.
20198
328ab8e7
PE
20199 * buffer.c (Fprevious_overlay_change): Remove var that is set
20200 but not used.
20201
e5a2a5cb
PE
20202 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
20203 Remove vars that are set but not used.
8d84a6eb 20204 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 20205 (timer_check_2): Mark vars as initialized.
e5a2a5cb 20206
a60e5f68
PE
20207 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
20208
f661cb61 20209 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 20210 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 20211
f0397f5a
PE
20212 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
20213 that are set but not used.
20214
8664db06 20215 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 20216 if XCreateBitmapFromData fails (Bug#8410).
8664db06 20217
6abdaa4a
PE
20218 * xselect.c (x_get_local_selection, x_handle_property_notify):
20219 Remove vars that are set but not used.
20220
0ce7538d 20221 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 20222 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 20223
9ae848fc
PE
20224 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
20225 Remove var that is set but not used.
0b918413
PE
20226 (scroll_bar_windows_size): Now size_t, not int.
20227 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
20228 Check for overflow.
9ae848fc 20229
a5a62657
PE
20230 * xfaces.c (realize_named_face): Remove vars that are set but not used.
20231 (map_tty_color) [!defined MSDOS]: Likewise.
20232
5c5cdd39
PE
20233 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
20234
66ebf983
PE
20235 * coding.c: Remove vars that are set but not used.
20236 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
20237 All callers changed.
20238 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
20239 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
20240 (decode_coding_charset): Remove vars that are set but not used.
20241
1be4d761
PE
20242 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
20243 that is set but not used.
20244
47553fa8
PE
20245 * print.c (print_object): Remove var that is set but not used.
20246
1f7196bf 20247 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
20248 The gnulib version avoids calling malloc in the usual case,
20249 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
20250 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
20251 * filelock.c (current_lock_owner): Likewise.
20252 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
20253 * sysdep.c: Include allocator.h, careadlinkat.h.
20254 (emacs_no_realloc_allocator): New static constant.
20255 (emacs_readlink): New function.
fdb61804
PE
20256 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
20257 ../lib/careadlinkat.h.
d1fdcab7 20258
f84c17c7
SM
202592011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
20260
20261 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
20262 first non-nil return value).
20263
ef3862ad
JD
202642011-04-03 Jan Djärv <jan.h.d@swipnet.se>
20265
20266 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
20267 if not defined (Bug#8403).
20268
376a7006
JB
202692011-04-02 Juanma Barranquero <lekktu@gmail.com>
20270
20271 * xdisp.c (display_count_lines): Remove parameter `start',
20272 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
20273 (get_char_face_and_encoding): Remove parameter `multibyte_p',
20274 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
20275 (fill_stretch_glyph_string): Remove parameters `row' and `area',
20276 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
20277 and thereabouts. All callers changed.
20278 (get_per_char_metric): Remove parameter `f', unused since
20279 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
20280
6ca3801d
JM
202812011-04-02 Jim Meyering <meyering@redhat.com>
20282
20283 do not dereference NULL upon failed strdup
20284 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
20285 (ns_get_family): Likewise.
20286
d8e2b5ba
JB
202872011-04-02 Juanma Barranquero <lekktu@gmail.com>
20288
20289 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
20290
8c74fcbd
JD
202912011-04-02 Jan Djärv <jan.h.d@swipnet.se>
20292
20293 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
20294 later (Bug#8403).
20295
7200d79c
SM
202962011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
20297
03408648 20298 Add lexical binding.
7200d79c 20299
03408648
SM
20300 * window.c (Ftemp_output_buffer_show): New fun.
20301 (Fsave_window_excursion):
20302 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
20303
20304 * lread.c (lisp_file_lexically_bound_p): New function.
20305 (Fload): Bind Qlexical_binding.
20306 (readevalloop): Remove `evalfun' arg.
20307 Bind Qinternal_interpreter_environment.
20308 (Feval_buffer): Bind Qlexical_binding.
20309 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
20310 Mark as dynamic.
20311 (syms_of_lread): Declare `lexical-binding'.
20312
20313 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
20314
20315 * keyboard.c (eval_dyn): New fun.
20316 (menu_item_eval_property): Use it.
ca105506
SM
20317
20318 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 20319
03408648
SM
20320 * fns.c (concat, mapcar1): Accept byte-code-functions.
20321
20322 * eval.c (Fsetq): Handle lexical vars.
20323 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
20324 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
20325 (FletX, Flet): Obey lexical binding.
20326 (Fcommandp): Handle closures.
20327 (Feval): New `lexical' arg.
20328 (eval_sub): New function extracted from Feval. Use it almost
20329 everywhere where Feval was used. Look up vars in lexical env.
20330 Handle closures.
20331 (Ffunctionp): Move from subr.el.
20332 (Ffuncall): Handle closures.
20333 (apply_lambda): Remove `eval_flags'.
20334 (funcall_lambda): Handle closures and new byte-code-functions.
20335 (Fspecial_variable_p): New function.
20336 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
20337 but without exporting it to Lisp.
23aba0ea 20338
23aba0ea 20339 * doc.c (Fdocumentation, store_function_docstring):
03408648 20340 * data.c (Finteractive_form): Handle closures.
23aba0ea 20341
03408648
SM
20342 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
20343 interactive spec.
ba83908c 20344
04f2d78b
CB
20345 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
20346 New byte-codes.
03408648
SM
20347 (exec_byte_code): New function extracted from Fbyte_code to handle new
20348 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 20349
03408648 20350 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 20351
03408648 20352 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 20353
e2abce01
JB
203542011-03-31 Juanma Barranquero <lekktu@gmail.com>
20355
20356 * xdisp.c (redisplay_internal): Fix prototype.
20357
63696a73 203582011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 20359
63696a73 20360 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
20361 (try_scrolling): Use it when setting scroll_limit.
20362 Limit scrolling to 100 screen lines.
63696a73
EZ
20363 (redisplay_window): Even when falling back on "recentering",
20364 position point in the window according to scroll-conservatively,
20365 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
20366
20367 (try_scrolling): When point is above the window, allow searching
20368 as far as scroll_max, or one screenful, to compute vertical
20369 distance from PT to the scroll margin position. This prevents
20370 try_scrolling from unnecessarily failing when
20371 scroll-conservatively is set to a value slightly larger than the
20372 window height. Clean up the case of PT below the margin at bottom
20373 of window: scroll_max can no longer be INT_MAX. When aggressive
20374 scrolling is in use, don't let point enter the opposite scroll
20375 margin as result of the scroll.
20376 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
20377 threshold of 100 lines for never-recentering scrolling.
20378
e4cc2dfc
JB
203792011-03-31 Juanma Barranquero <lekktu@gmail.com>
20380
20381 * dispextern.h (move_it_by_lines):
20382 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
20383 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
20384 (message_log_check_duplicate): Remove parameters `prev_bol' and
20385 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
20386 (redisplay_internal): Remove parameter `preserve_echo_area',
20387 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
20388
20389 * indent.c (Fvertical_motion):
20390 * window.c (window_scroll_pixel_based, Frecenter):
20391 Don't pass `need_y_p' to `move_it_by_lines'.
20392
1c470562
SM
203932011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
20394
44f230aa
SM
20395 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
20396 steal a few bits to be more compact.
20397 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
20398 Remove unneeded casts.
20399
1c470562
SM
20400 * bytecode.c (Fbyte_code): CAR and CDR can GC.
20401
888adce9
ZK
204022011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
20403
20404 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
20405 binding" message (bug#7967).
20406
f838ed7b
PE
204072011-03-30 Paul Eggert <eggert@cs.ucla.edu>
20408
77861b95
PE
20409 Fix more problems found by GCC 4.6.0's static checks.
20410
de6dbc14
PE
20411 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
20412 Remove unused local var.
20413
f838ed7b
PE
20414 * editfns.c (Fmessage_box): Remove unused local var.
20415
792c7b2b
PE
20416 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
20417 (note_mode_line_or_margin_highlight, note_mouse_highlight):
20418 Omit unused local vars.
c499e557 20419 * window.c (shrink_windows): Omit unused local var.
b01a1c29 20420 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
20421 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
20422 Omit unused local var.
20423
ba0165e1
PE
20424 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
20425 Don't assume string length fits in int.
32ad8845 20426 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 20427 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 20428
3c59b4c9
PE
20429 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
20430 instead of alloca (Bug#8344).
20431
a3eed478 20432 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 20433 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 20434
eb4d412d
PE
20435 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
20436
1658b401
PE
20437 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
20438 concerns.
20439
20440 * term.c (produce_glyphless_glyph): Remove unnecessary test.
20441
20442 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 20443
9a2c6e05
PE
20444 * keyboard.c (syms_of_keyboard): Use the same style as later
20445 in this function when indexing through an array. This also
20446 works around GCC bug 48267.
20447
03d0a109
PE
20448 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
20449
44f730c8
PE
20450 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
20451
fe75f926
PE
20452 * chartab.c (sub_char_table_ref_and_range): Redo for slight
20453 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
20454
ffa8c828
PE
20455 * keyboard.c, keyboard.h (num_input_events): Now size_t.
20456 This avoids undefined behavior on integer overflow, and is a bit
20457 more convenient anyway since it is compared to a size_t variable.
20458
c5101a77
PE
20459 Variadic C functions now count arguments with size_t, not int.
20460 This avoids an unnecessary limitation on 64-bit machines, which
20461 caused (substring ...) to crash on large vectors (Bug#8344).
20462 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
20463 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 20464 All variadic functions and their callers changed accordingly.
c5101a77
PE
20465 (struct gcpro.nvars): Now size_t, not int. All uses changed.
20466 * data.c (arith_driver, float_arith_driver): Likewise.
20467 * editfns.c (general_insert_function): Likewise.
20468 * eval.c (struct backtrace.nargs, interactive_p)
20469 (internal_condition_case_n, run_hook_with_args, apply_lambda)
20470 (funcall_lambda, mark_backtrace): Likewise.
20471 * fns.c (concat): Likewise.
20472 * frame.c (x_set_frame_parameters): Likewise.
20473 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
20474 0 if not found, not -1. All callers changed.
20475
dd3f25f7
PE
20476 * alloc.c (garbage_collect): Don't assume stack size fits in int.
20477 (stack_copy_size): Now size_t, not int.
20478 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
20479
461c2ab9
JB
204802011-03-28 Juanma Barranquero <lekktu@gmail.com>
20481
20482 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
20483 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
20484 All callers changed.
20485
20486 * lisp.h (multibyte_char_to_unibyte):
20487 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
20488 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
20489 * character.h (CHAR_TO_BYTE8):
20490 * cmds.c (internal_self_insert):
20491 * editfns.c (general_insert_function):
20492 * keymap.c (push_key_description):
20493 * search.c (Freplace_match):
20494 * xdisp.c (message_dolog, set_message_1): All callers changed.
20495
f6d62986
SM
204962011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
20497
20498 * keyboard.c (safe_run_hook_funcall): New function.
20499 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
20500 don't set the hook to nil, but remove the offending function instead.
20501 (Qcommand_hook_internal): Remove, unused.
20502 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
20503 Vcommand_hook_internal.
20504
20505 * eval.c (enum run_hooks_condition): Remove.
20506 (funcall_nil, funcall_not): New functions.
20507 (run_hook_with_args): Call each function through a `funcall' argument.
20508 Remove `cond' argument, now redundant.
20509 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
20510 (Frun_hook_with_args_until_failure): Adjust accordingly.
20511 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
20512
1db5b1ad
JB
205132011-03-28 Juanma Barranquero <lekktu@gmail.com>
20514
20515 * dispextern.h (string_buffer_position): Remove declaration.
20516
20517 * print.c (strout): Remove parameter `multibyte', unused since
20518 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
20519
20520 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
20521 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
20522 All callers changed.
20523
20524 * w32.c (_wsa_errlist): Use braces for struct initializers.
20525
20526 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
20527 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
20528 All callers changed.
20529 (string_buffer_position): Likewise. Also, make static (it's never
20530 used outside xdisp.c).
20531 (cursor_row_p): Remove parameter `w', unused since
20532 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
20533 (decode_mode_spec): Remove parameter `precision', introduced during
20534 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
20535 All callers changed.
20536
5ffb62aa
JD
205372011-03-27 Jan Djärv <jan.h.d@swipnet.se>
20538
20539 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
20540
461c2ab9 205412011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
20542
20543 * nsterm.m (ns_menu_bar_is_hidden): New variable.
20544 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
20545 (ns_update_auto_hide_menu_bar): New functions.
20546 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
20547 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
20548 ns_constrain_all_frames.
20549 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
20550 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
20551
5c380ffb
JD
205522011-03-27 Jan Djärv <jan.h.d@swipnet.se>
20553
20554 * nsmenu.m (runDialogAt): Remove argument to timer_check.
20555
9af30bdf
GM
205562011-03-27 Glenn Morris <rgm@gnu.org>
20557
20558 * syssignal.h: Replace RETSIGTYPE with void.
20559 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
20560 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
20561 Replace SIGTYPE with void everywhere.
20562 * s/usg5-4-common.h (SIGTYPE): Remove definition.
20563 * s/template.h (SIGTYPE): Remove commented out definition.
20564
e2abce01
JB
205652011-03-26 Eli Zaretskii <eliz@gnu.org>
20566
20567 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
20568 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
20569
f868cd8a
JB
205702011-03-26 Juanma Barranquero <lekktu@gmail.com>
20571
59eb0929
JB
20572 * w32.c (read_unc_volume): Use parameter `henum', instead of
20573 global variable `wget_enum_handle'.
20574
20575 * keymap.c (describe_vector): Remove parameters `indices' and
20576 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
20577 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
20578
f868cd8a
JB
20579 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
20580
20581 * keyboard.c (timer_check): Remove parameter `do_it_now',
20582 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
20583 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
20584 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
20585
20586 * keyboard.c (read_char):
20587 * w32menu.c (w32_menu_display_help):
20588 * xmenu.c (show_help_event, menu_help_callback):
20589 Adjust calls to `show_help_echo'.
20590
20591 * gtkutil.c (xg_maybe_add_timer):
20592 * keyboard.c (readable_events):
20593 * process.c (wait_reading_process_output):
20594 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
20595
20596 * insdel.c (adjust_markers_gap_motion):
20597 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
20598 (gap_left, gap_right): Don't call it.
20599
2ecf6fdb
CY
206002011-03-25 Chong Yidong <cyd@stupidchicken.com>
20601
20602 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
20603 incurred during fontification.
20604
6b1f9ba4
JB
206052011-03-25 Juanma Barranquero <lekktu@gmail.com>
20606
20607 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
20608 (DEFVAR_PER_BUFFER): Don't pass it.
20609
20610 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
20611 (scrolling_window): Don't pass it.
20612
0f4a96b5
JB
206132011-03-25 Juanma Barranquero <lekktu@gmail.com>
20614
20615 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
20616
20617 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
20618 and `suffix'.
20619 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
20620 of variables specific to SELinux and computation of `encoded_absname'.
20621
20622 * image.c (XPutPixel): Remove unused variable `height'.
20623
20624 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
20625
20626 * unexw32.c (get_section_info): Remove unused variable `section'.
20627
20628 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
20629 (system_process_attributes): Remove unused variable `sess'.
20630 (sys_read): Remove unused variable `err'.
20631
20632 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
20633 (w32_wnd_proc): Remove unused variable `isdead'.
20634 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
20635 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
20636 (x_create_tip_frame): Remove unused variable `tem'.
20637
20638 * w32inevt.c (w32_console_read_socket):
20639 Remove unused variable `no_events'.
20640
20641 * w32term.c (x_draw_composite_glyph_string_foreground):
20642 Remove unused variable `width'.
20643
1149507c
JB
206442011-03-24 Juanma Barranquero <lekktu@gmail.com>
20645
20646 * w32term.c (x_set_glyph_string_clipping):
20647 Don't pass uninitialized region to CombineRgn.
20648
9c88f339
JB
206492011-03-23 Juanma Barranquero <lekktu@gmail.com>
20650
20651 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
20652 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
20653 (Fx_close_connection): Remove unused variable `i'.
20654
20655 * w32font.c (w32font_draw): Return number of glyphs.
20656 (w32font_open_internal): Remove unused variable `i'.
20657 (w32font_driver): Add missing initializer.
20658
20659 * w32menu.c (utf8to16): Remove unused variable `utf16'.
20660 (fill_in_menu): Remove unused variable `items_added'.
20661
20662 * w32term.c (last_mouse_press_frame): Remove static global variable.
20663 (w32_clip_to_row): Remove unused variable `f'.
20664 (x_delete_terminal): Remove unused variable `i'.
20665
20666 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
20667 (NOTHING): Remove unused static global variable.
20668 (uniscribe_check_otf): Remove unused variable `table'.
20669 (uniscribe_font_driver): Add missing initializers.
20670
dee091a3
JD
206712011-03-23 Julien Danjou <julien@danjou.info>
20672
20673 * term.c (Fsuspend_tty, Fresume_tty):
20674 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
20675 * window.c (temp_output_buffer_show):
20676 * insdel.c (signal_before_change):
20677 * frame.c (Fhandle_switch_frame):
20678 * fileio.c (Fdo_auto_save):
20679 * emacs.c (Fkill_emacs):
20680 * editfns.c (save_excursion_restore):
20681 * cmds.c (internal_self_insert):
20682 * callint.c (Fcall_interactively):
20683 * buffer.c (Fkill_all_local_variables):
20684 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
20685 Use Frun_hooks.
0f4a96b5 20686 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 20687 unconditionally since it does the check itself.
dee091a3 20688
2c520ab5 206892011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 20690
c9c49752
PE
20691 Fix more problems found by GCC 4.5.2's static checks.
20692
8abc3f12
PE
20693 * coding.c (encode_coding_raw_text): Avoid unnecessary test
20694 the first time through the loop, since we know p0 < p1 then.
20695 This also avoids a gcc -Wstrict-overflow warning.
20696
a2d26660
PE
20697 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
20698 leading to a memory leak, possible in functions like
20699 load_charset_map_from_file that can allocate an unbounded number
b12ef411 20700 of objects (Bug#8318).
a2d26660 20701
916c72e9
PE
20702 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
20703 that could (at least in theory) be that large.
20704
19ab8a18
PE
20705 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
20706 This is less likely to overflow, and avoids undefined behavior if
20707 overflow does occur. All callers changed. Use strtoul to scan
20708 for the unsigned long integer.
b7cbbd6f
PE
20709 (pint2hrstr): Simplify and tune code slightly.
20710 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 20711
f0641eff
PE
20712 * scroll.c (do_scrolling): Work around GCC bug 48228.
20713 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
20714
7f650bb9
PE
20715 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
20716 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
20717 (validate_x_resource_name): Simplify count usage.
20718 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 20719
37dd57d1
PE
20720 * fileio.c (Fcopy_file): Report error if fchown or fchmod
20721 fail (Bug#8306).
81e56e61 20722
699979fc 20723 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 20724
401bf9b4
PE
20725 * process.c (Fmake_network_process): Use socklen_t, not int,
20726 where POSIX says socklen_t is required in portable programs.
20727 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 20728 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
20729 (Fmake_network_process, server_accept_connection):
20730 (wait_reading_process_output, read_process_output):
20731 Likewise.
20732
b93aacde
PE
20733 * process.c: Rename or move locals to avoid shadowing.
20734 (list_processes_1, Fmake_network_process):
20735 (read_process_output_error_handler, exec_sentinel_error_handler):
20736 Rename or move locals.
4dc343ee 20737 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 20738 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 20739 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 20740 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 20741 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 20742
af8a867c 20743 Make tparam.h and terminfo.c consistent.
44f230aa
SM
20744 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
20745 Include tparam.h instead, since it declares them.
af8a867c
PE
20746 * cm.h (PC): Remove extern decl; tparam.h now does this.
20747 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
20748 * terminfo.c: Include tparam.h, to check interfaces.
20749 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
20750 (tparam): Adjust signature to match interface in tparam.h;
20751 this removes some undefined behavior. Check that outstring and len
20752 are zero, which they always are with Emacs.
20753 * tparam.h (PC, BC, UP): New extern decls.
20754
0248044d 20755 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 20756 (xftfont_open): Rename locals to avoid shadowing.
0248044d 20757
8ff096c1 20758 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
20759 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
20760 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 20761 (ftfont_list): Remove unused local.
49eaafba
PE
20762 (get_adstyle_property, ftfont_pattern_entity):
20763 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
20764 Rename locals to avoid shadowing.
8ff096c1 20765
e2be39f6
PE
20766 * xfont.c (xfont_list_family): Mark var as initialized.
20767
c9735e30
PE
20768 * xml.c (make_dom): Now static.
20769
8f5201ae
PE
20770 * composite.c (composition_compute_stop_pos): Rename local to
20771 avoid shadowing.
b246f932
PE
20772 (composition_reseat_it): Remove unused locals.
20773 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 20774 (composition_update_it): Mark var as initialized.
11b61122
PE
20775 (find_automatic_composition): Mark vars as initialized,
20776 with a FIXME (Bug#8290).
8f5201ae 20777
760fbc2c
PE
20778 character.h: Rename locals to avoid shadowing.
20779 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
20780 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
20781 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
20782 (BUF_DEC_POS): Be more systematic about renaming local temporaries
20783 to avoid shadowing.
20784
ff08eb85
PE
20785 * textprop.c (property_change_between_p): Remove; unused.
20786
fc7bf025
PE
20787 * intervals.c (interval_start_pos): Now static.
20788
235d7abc
PE
20789 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
20790
44f230aa
SM
20791 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
20792 Rename locals to avoid shadowing.
3e7d6594 20793
50060332
PE
20794 * sound.c (wav_play, au_play, Fplay_sound_internal):
20795 Fix pointer signedness.
d01f234b 20796 (alsa_choose_format): Remove unused local var.
c83b8872
PE
20797 (wav_play): Initialize a variable to 0, to prevent undefined
20798 behavior (Bug#8278).
50060332 20799
c4fc4e30
PE
20800 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
20801
918436ed
PE
20802 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
20803
c939f91b
PE
20804 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
20805 clobbering (Bug#8298).
b9c7f648
PE
20806 * sysdep.c (sys_subshell): Likewise.
20807 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 20808
6bd8c144
PE
20809 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
20810 This should get cleaned up, so that child_setup has the
20811 same signature on all platforms.
20812
7710357c 20813 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 20814 (relocate_fd): Rename locals to avoid shadowing.
7710357c 20815
c59da222
CY
208162011-03-22 Chong Yidong <cyd@stupidchicken.com>
20817
20818 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
20819 not to be necessary, and produces flickering.
20820
66b87493
GM
208212011-03-20 Glenn Morris <rgm@gnu.org>
20822
20823 * config.in: Remove file.
20824
45b6f6d5
JB
208252011-03-20 Juanma Barranquero <lekktu@gmail.com>
20826
20827 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
20828 are now in src/globals.h.
20829 (syms_of_minibuf): Remove spurious & from previous change.
20830
cd394be1 208312011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
20832
20833 * minibuf.c (completing-read-function): New variable.
20834 (completing-read-default): Rename from completing-read.
20835 (completing-read): Call completing-read-function.
20836
b14e3e21
CY
208372011-03-19 Juanma Barranquero <lekktu@gmail.com>
20838
20839 * xfaces.c (Fx_load_color_file):
20840 Read color file from absolute filename (bug#8250).
20841
f2b726e6
JB
208422011-03-19 Juanma Barranquero <lekktu@gmail.com>
20843
20844 * makefile.w32-in: Update dependencies.
20845
09f6ff02
EZ
208462011-03-17 Eli Zaretskii <eliz@gnu.org>
20847
20848 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
20849
29a6015a
PE
208502011-03-17 Paul Eggert <eggert@cs.ucla.edu>
20851
a3a6c54e
PE
20852 Fix more problems found by GCC 4.5.2's static checks.
20853
b766f867
PE
20854 * process.c (make_serial_process_unwind, send_process_trap):
20855 (sigchld_handler): Now static.
20856
be02381c
PE
20857 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
20858 That way, the code declares only the vars that it needs.
20859 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
20860 * s/cygwin.h (PTY_ITERATION): Likewise.
20861 * s/darwin.h (PTY_ITERATION): Likewise.
20862 * s/gnu-linux.h (PTY_ITERATION): Likewise.
20863
57048744
PE
20864 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
20865 * process.c (allocate_pty): Don't declare stb unless it's needed.
20866
7914961c 20867 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
20868 (CONSTANTLIM): Remove; unused.
20869 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
20870 Define only if needed.
7914961c 20871
b3967b18
PE
20872 * unexelf.c (unexec): Name an expression,
20873 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
20874 Use a different way to cause a compilation error if anyone uses
20875 n rather than nn, a way that does not involve shadowing.
73366a00 20876 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 20877
29a6015a
PE
20878 * deps.mk (unexalpha.o): Remove; unused.
20879
43cfc33e 20880 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 20881 * unexec.h: New file.
ce701a33
PE
20882 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
20883 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
20884 Depend on unexec.h.
20885 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
20886 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
20887 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 20888 Change as necessary to match prototype in unexec.h.
ce701a33 20889
01f44d5a
PE
20890 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
20891 shadowing.
4f63c6bb 20892 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 20893
a6670b0b
PE
20894 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
20895 Rename locals to avoid shadowing.
20896
cef2010d 20897 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 20898 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 20899
d4d7173a
PE
20900 * print.c (Fredirect_debugging_output): Fix pointer signedess.
20901
f08b802a
PE
20902 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
20903 warning when compiling print.c.
20904
3ddb0639
PE
20905 * font.c (font_unparse_fcname): Abort in an "impossible" situation
20906 instead of using an uninitialized var.
5ad03b97 20907 (font_sort_entities): Mark var as initialized.
3ddb0639 20908
170a2692
PE
20909 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
20910
e663c700
PE
20911 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
20912 pointers to constants.
89bc529a 20913 (font_parse_fcname): Remove unused vars.
7b81e2d0 20914 (font_delete_unmatched): Now static.
ea838e10 20915 (font_get_spec): Remove; unused.
13a547c6
PE
20916 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
20917 (font_update_drivers, Ffont_get_glyphs, font_add_log):
20918 Rename or move locals to avoid shadowing.
e663c700 20919
2a80c887 20920 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 20921 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 20922
1384fa33 20923 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 20924 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 20925
8b2c52e9
PE
20926 * alloc.c (mark_backtrace): Move decl from here ...
20927 * lisp.h: ... to here, so that it can be checked.
20928
475545b5 20929 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 20930 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
20931 (lisp_indirect_variable): Name an expression,
20932 to avoid gcc -Wbad-function-cast warning.
1faed8ae 20933 (Fdefvar): Rename locals to avoid shadowing.
475545b5 20934
b1349114 20935 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 20936 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 20937 Use const pointer when appropriate.
b1349114 20938
a2928364
PE
20939 * lisp.h (get_system_name, get_operating_system_release):
20940 Move decls here, to check interfaces.
20941 * process.c (get_operating_system_release): Move decl to lisp.h.
20942 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
20943 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
20944 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
20945 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
20946 (Fformat_time_string, Fencode_time, Finsert_char):
20947 (Ftranslate_region_internal, Fformat):
20948 Rename or remove local vars to avoid shadowing.
9710023e 20949 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 20950
a415e694
PE
20951 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
20952 avoid shadowing.
20953
8ef4622d
PE
20954 * lisp.h (eassert): Check that the argument compiles, even if
20955 ENABLE_CHECKING is not defined.
20956
946f9a5b
PE
20957 * data.c (Findirect_variable): Name an expression, to avoid
20958 gcc -Wbad-function-cast warning.
112396d6 20959 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 20960 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
20961 (Fmake_variable_buffer_local, Fmake_local_variable):
20962 Mark variables as initialized.
52746918 20963 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 20964
e5aab7e7 20965 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
20966 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
20967 Rename locals to avoid shadowing.
dff45157
PE
20968 (mark_stack): Move local variables into the #ifdef region where
20969 they're used.
7bc26fdb
PE
20970 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
20971 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
20972 needed otherwise.
20973 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
20974 (GC_STRING_CHARS): Remove; not used.
d40d4be1 20975 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 20976
e5aab7e7
PE
20977 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
20978 avoids undefined behavior in theory.
20979
4da60324
PE
20980 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
20981
88043301
PE
20982 Use functions, not macros, for up- and down-casing (Bug#8254).
20983 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
20984 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
20985 to use the following functions instead of these macros.
20986 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
20987 EMACS_INT, since callers assume the returned value fits in int.
20988 (upcase1): Likewise, for UPCASE_TABLE.
20989 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 20990 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 20991 the race-condition problem in the old DOWNCASE.
88043301 20992
19ed5445
PE
20993 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
20994 Rename locals to avoid shadowing.
20995 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
20996 (regex_compile, re_search_2, re_match_2_internal):
20997 Remove unused local vars.
952db0d7
PE
20998 (FREE_VAR): Rewrite so as not to use empty "else",
20999 which gcc can warn about.
da053e48 21000 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
21001 (RETALLOC_IF): Define only if needed.
21002 (WORDCHAR_P): Likewise. This one is never needed, but is used
21003 only in a comment talking about a compiler bug, so put inside
21004 the #if 0 of that comment.
21005 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
21006 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
21007 Remove; unused.
19ed5445 21008
1f3561e4 21009 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
21010 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
21011 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 21012
ded6f8f7
PE
21013 * search.c (simple_search): Remove unused var.
21014
dbd37a95
PE
21015 * dired.c (compile_pattern): Move decl from here ...
21016 * lisp.h: ... to here, so that it can be checked.
21017 (struct re_registers): New forward decl.
21018
7e47afad
PE
21019 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
21020
85f24f61
PE
21021 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
21022 All uses changed.
21023 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
21024 Rename locals to avoid shadowing.
5671df8f 21025 (Fvertical_motion): Mark locals as initialized.
85f24f61 21026
181aa2be 21027 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 21028 (casify_region): Mark local as initialized.
181aa2be 21029
930d429c
PE
21030 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
21031
7082eac6
PE
21032 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
21033 New macros, so that the caller can use some names other than
21034 gcpro1, gcpro2, etc.
21035 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
21036 of the new macros.
21037 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
21038 argument, for consistency with GCPRO2_VAR, etc: it is now the
21039 prefix of the variable, not the variable itself. All uses
21040 changed.
38b2c076
PE
21041 * dired.c (directory_files_internal, file_name_completion):
21042 Rename locals to avoid shadowing.
21043
15206ed9
PE
21044 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
21045 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
21046 dired.c's scmp function, had undefined behavior.
21047 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
21048 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
21049 * buffer.h: ... to here, because these macros use current_buffer,
21050 and the new implementation with inline functions needs to have
21051 current_buffer in scope now, rather than later when the macros
21052 are used.
21053 (downcase, upcase1): New static inline functions.
21054 (DOWNCASE, UPCASE1): Reimplement using these functions.
21055 This avoids undefined behavior in expressions like
21056 DOWNCASE (x) == DOWNCASE (y), which previously suffered
21057 from race conditions in accessing the global variables
21058 case_temp1 and case_temp2.
21059 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
21060 * lisp.h (case_temp1, case_temp2): Remove their decls.
21061 * character.h (ASCII_CHAR_P): Move from here ...
21062 * lisp.h: ... to here, so that the inline functions mentioned
21063 above can use them.
21064
4a6bea26
PE
21065 * dired.c (directory_files_internal_unwind): Now static.
21066
f14b7e14
PE
21067 * fileio.c (file_name_as_directory, directory_file_name):
21068 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
21069 Now static.
2893f146
PE
21070 (file_name_as_directory): Use const pointers when appropriate.
21071 (Fexpand_file_name): Likewise. In particular, newdir might
21072 point at constant storage, so make it a const pointer.
fd4ead52 21073 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
21074 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
21075 signedness issues.
f839df0c
PE
21076 (Fset_file_times, Finsert_file_contents, auto_save_error):
21077 Rename locals to avoid shadowing.
f14b7e14 21078
5716756e 21079 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
21080 (Ftry_completion, Fall_completions): Rename or remove locals
21081 to avoid shadowing.
5716756e 21082
b4c3046a
PE
21083 * marker.c (bytepos_to_charpos): Remove; unused.
21084
b45db522
PE
21085 * lisp.h (verify_bytepos, count_markers): New decls,
21086 so that gcc does not warn that these functions aren't declared.
21087
85876d07
PE
21088 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
21089 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 21090 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 21091 (copy_text): Remove unused local var.
85876d07 21092
03d78a21 21093 * filelock.c (within_one_second): Now static.
b3dd38ab 21094 (lock_file_1): Rename local to avoid shadowing.
03d78a21 21095
5df8f01b
PE
21096 * buffer.c (fix_overlays_before): Mark locals as initialized.
21097 (fix_start_end_in_overlays): Likewise. This function should be
21098 simplified by using pointers-to-pointers, but that's a different
21099 matter.
b1d876f1 21100 (switch_to_buffer_1): Now static.
8f54f30a
PE
21101 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
21102 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 21103
a70072c9 21104 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 21105 Fix pointer signedness issue.
edced198
PE
21106 (sys_subshell): Mark local as volatile if checking for lint,
21107 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 21108 (MAXPATHLEN): Define only if needed.
a70072c9 21109
a0977c44
PE
21110 * process.c (serial_open, serial_configure): Move decls from here ...
21111 * systty.h: ... to here, so that they can be checked.
21112
a884fdcc
PE
21113 * fns.c (get_random, seed_random): Move extern decls from here ...
21114 * lisp.h: ... to here, so that they can be checked.
21115
604efe86 21116 * sysdep.c (reset_io): Now static.
b8950c94 21117 (wait_for_termination_signal): Remove; unused.
604efe86 21118
38fc62d9
PE
21119 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
21120 (copy_keymap_item, append_key, push_text_char_description):
21121 Now static.
1004a21a 21122 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 21123 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
21124 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
21125 (describe_map_tree):
21126 Rename locals to avoid shadowing.
38fc62d9 21127
2f2650da
PE
21128 * keyboard.c: Declare functions static if they are not used elsewhere.
21129 (echo_char, echo_dash, cmd_error, top_level_2):
21130 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
21131 (read_char, kbd_buffer_get_event, make_lispy_position):
21132 (make_lispy_event, make_lispy_movement, apply_modifiers):
21133 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
21134 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
21135 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 21136 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 21137 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 21138
a053e86c 21139 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
21140 (mark_kboards): Move decl here ...
21141 * alloc.c (mark_kboards): ... from here.
a053e86c 21142
4752793e
PE
21143 * lisp.h (force_auto_save_soon): New decl.
21144
74f10ca7 21145 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
21146 (DEFINE_DUMMY_FUNCTION): New macro.
21147 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
21148 Use it.
c03cd23f
PE
21149 (main): Add casts to avoid warnings
21150 if GCC considers string literals to be constants.
74f10ca7 21151
022e70d4
PE
21152 * lisp.h (fatal_error_signal): Add decl, since it's exported.
21153
59d6fe83
PE
21154 * dbusbind.c: Pointer signedness fixes.
21155 (xd_signature, xd_append_arg, xd_initialize):
21156 (Fdbus_call_method, Fdbus_call_method_asynchronously):
21157 (Fdbus_method_return_internal, Fdbus_method_error_internal):
21158 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
21159 (Fdbus_register_signal): Use SSDATA when the context wants char *.
21160
78320123
PE
21161 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
21162 if GCC considers string literals to be constants.
49cebcca 21163 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 21164
35ac2a97
SM
211652011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
21166
fb103ca9
SM
21167 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
21168 (print_preprocess, print_object): New macro to fix last change.
21169
35ac2a97
SM
21170 * print.c (print_preprocess): Don't forget font objects.
21171
62973b41
JB
211722011-03-16 Juanma Barranquero <lekktu@gmail.com>
21173
21174 * emacs.c (USAGE3): Doc fixes.
21175
0e48bb22
AS
211762011-03-15 Andreas Schwab <schwab@linux-m68k.org>
21177
21178 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
21179 structure.
21180
7684e57b
JB
211812011-03-14 Juanma Barranquero <lekktu@gmail.com>
21182
21183 * lisp.h (VWindow_system, Qfile_name_history):
21184 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
21185 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
21186 (w32_system_caret_x, w32_system_caret_y): Declare extern.
21187
21188 * w32select.c: Don't #include "keyboard.h".
c96bbc66 21189 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
21190
21191 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
21192 * w32console.c (detect_input_pending, read_input_pending)
21193 (encode_terminal_code):
21194 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
21195 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
21196 (w32_system_caret_y, Qfile_name_history):
21197 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
21198 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
21199 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
21200 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
21201 * w32proc.c (Qlocal, report_file_error):
21202 * w32term.c (Vwindow_system, updating_frame):
21203 * w32uniscribe.c (initialized, uniscribe_font_driver):
21204 Remove unneeded extern declarations.
21205
2aa46d6c
CY
212062011-03-14 Chong Yidong <cyd@stupidchicken.com>
21207
c96bbc66 21208 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 21209
cffc6f3b
CY
212102011-03-13 Chong Yidong <cyd@stupidchicken.com>
21211
21212 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
21213 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
21214 These macros can no longer be used for assignment.
21215
44f230aa
SM
21216 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
21217 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
21218 (record_buffer_markers, fetch_buffer_markers): New functions for
21219 recording and fetching special buffer markers.
21220 (set_buffer_internal_1, set_buffer_temp): Use them.
21221
21222 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
21223
21224 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
21225
21226 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
21227 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
21228
21229 * xdisp.c (hscroll_window_tree):
21230 (reconsider_clip_changes): Use PT instead of BUF_PT.
21231
d251f04b
EZ
212322011-03-13 Eli Zaretskii <eliz@gnu.org>
21233
21234 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
21235 $(EMACS_ROOT)/lib/intprops.h.
21236
f0c77cd1
PE
212372011-03-13 Paul Eggert <eggert@cs.ucla.edu>
21238
3eca4629
PE
21239 Fix more problems found by GCC 4.5.2's static checks.
21240
7c86ee98
PE
21241 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
21242 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
21243 (xg_free_frame_widgets): Make it clear that a local variable is
21244 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
21245 (gdk_window_get_screen): Make it clear that this macro is needed
21246 only if USE_GTK_TOOLTIP.
1e5524e7
PE
21247 (int_gtk_range_get_value): New function, which avoids a diagnostic
21248 from gcc -Wbad-function-cast.
21249 (xg_set_toolkit_scroll_bar_thumb): Use it.
21250 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
21251 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
21252 (get_utf8_string, xg_get_file_with_chooser):
21253 Rename locals to avoid shadowing.
21254 (create_dialog): Move locals to avoid shadowing.
7c86ee98 21255
41729b81
PE
21256 * xgselect.c (xg_select): Remove unused var.
21257
f0c77cd1
PE
21258 * image.c (four_corners_best): Mark locals as initialized.
21259 (gif_load): Initialize transparent_p to zero (Bug#8238).
21260 Mark another local as initialized.
ec6cf4c6 21261 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 21262
ce0ad53d 21263 * image.c (clear_image_cache): Now static.
d5d5a617 21264 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 21265 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
21266 (x_edge_detection): Remove unnecessary cast that
21267 gcc -Wbad-function-cast diagnoses.
2037898d 21268 (gif_load): Fix pointer signedness.
6ae141d6
PE
21269 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
21270 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 21271
33383987 212722011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 21273
d32df629
PE
21274 Improve quality of tests for time stamp overflow.
21275 For example, without this patch (encode-time 0 0 0 1 1
21276 1152921504606846976) returns the obviously-bogus value (-948597
21277 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
21278 reports time overflow. See
21279 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
21280 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
21281 * editfns.c: Include limits.h and intprops.h.
21282 (TIME_T_MIN, TIME_T_MAX): New macros.
21283 (time_overflow): Move earlier, to before first use.
21284 (hi_time, lo_time): New functions, for an accurate test for
21285 out-of-range times.
21286 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
21287 (Fget_internal_run_time): Don't assume time_t fits in int.
21288 (make_time): Use list2 instead of Fcons twice.
21289 (Fdecode_time): More accurate test for out-of-range times.
21290 (check_tm_member): New function.
21291 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
21292 (lisp_time_argument): Don't rely on undefined left-shift and
21293 right-shift behavior when checking for time stamp overflow.
8be6f318 21294
fe31d94c
PE
21295 * editfns.c (time_overflow): New function, refactoring common code.
21296 (Fformat_time_string, Fdecode_time, Fencode_time):
21297 (Fcurrent_time_string): Use it.
21298
8be6f318
PE
21299 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
21300 * dired.c (make_time): Move to ...
21301 * editfns.c (make_time): ... here.
21302 * systime.h: Note the move.
21303
09d9db2c 213042011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 21305
126bc0dc
YM
21306 * fringe.c (update_window_fringes): Remove unused variables.
21307
c47cbdfd
YM
21308 * unexmacosx.c (copy_data_segment): Also copy __got section.
21309 (Bug#8223)
21310
7ac80be9
EZ
213112011-03-12 Eli Zaretskii <eliz@gnu.org>
21312
c96bbc66 21313 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
21314 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
21315 Constify `char *' arguments and their references according to
21316 prototypes in tparam.h.
21317
ecb0f94d 21318 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 21319
7ac80be9
EZ
21320 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
21321 Adapt all references accordingly.
21322
21323 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
21324
ef1fd07e
TT
213252011-03-11 Tom Tromey <tromey@redhat.com>
21326
21327 * buffer.c (syms_of_buffer): Remove obsolete comment.
21328
7ef4b50c
EZ
213292011-03-11 Eli Zaretskii <eliz@gnu.org>
21330
21331 * termhooks.h (encode_terminal_code): Declare prototype.
21332
21333 * msdos.c (encode_terminal_code): Don't declare prototype.
21334
21335 * term.c (encode_terminal_code): Now external again, used by
21336 w32console.c and msdos.c.
21337
44f230aa
SM
21338 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
21339 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 21340
4b1ec863 213412011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 21342
1714f52b 21343 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 21344
4b1ec863
PE
21345 * fringe.c (update_window_fringes): Mark locals as initialized
21346 (Bug#8227).
21347 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 21348
524c7aa6
PE
21349 * alloc.c (mark_fringe_data): Move decl from here ...
21350 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
21351 to check its interface.
21352 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
21353
a5c0af81 21354 * fontset.c (free_realized_fontset): Now static.
7519b8cd 21355 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 21356 (fontset_font): Mark local as initialized.
a9a06e0b 21357 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 21358
b4716021
PE
21359 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
21360
811e9bac 21361 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 21362 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
21363 (x_own_selection, Fx_disown_selection_internal): Rename locals
21364 to avoid shadowing.
21365 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 21366
7e3ab302
PE
21367 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
21368 so that the caller can use some name other than gcpro1.
21369 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
21370 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
21371 (Fx_backspace_delete_keys_p):
21372 Use them to avoid shadowing, and rename vars to avoid shadowing.
21373 (x_decode_color, x_set_name, x_window): Now static.
6b437900 21374 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 21375 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
21376 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
21377 Remove unused locals.
7e3ab302
PE
21378 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
21379 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
21380 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
21381 macros.
f78faa98 21382
e2b13473
PE
21383 * xterm.h (x_mouse_leave): New decl.
21384
77f23912
PE
21385 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
21386 Remove unused functions.
cdf4ba58
PE
21387 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
21388 (x_calc_absolute_position): Now static.
7411c686 21389 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 21390 Don't declare local "event" unless it's used.
ed7bf3a5
PE
21391 (x_iconify_frame, x_free_frame_resources): Don't declare locals
21392 unless they are used.
38d0b34a
PE
21393 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
21394 (x_fatal_error_signal): Remove; not used.
a6067996
PE
21395 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
21396 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
21397 (x_error_catcher, x_connection_closed, x_error_handler):
21398 (x_error_quitter, xembed_send_message, x_iconify_frame):
21399 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 21400 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 21401 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 21402
44f230aa
SM
21403 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
21404 Rename or move locals to avoid shadowing.
6b463e58 21405 (tty_defined_color, merge_face_heights): Now static.
5967d051 21406 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
21407 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
21408 does not deduce is never used uninitialized.
73719eba
PE
21409 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
21410 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 21411
426994c3 21412 * terminal.c (store_terminal_param): Now static.
5489860b 21413
032f1620 21414 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 21415 (set_frame_menubar): Remove unused local.
d4323972 21416 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
21417 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
21418 since they might point to immutable storage.
281585b0
PE
21419 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
21420 since it's unused otherwise.
032f1620 21421
367c19e5 21422 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 21423 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
21424 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
21425 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 21426 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
21427 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
21428 does not deduce are never used uninitialized.
70739cbe 21429
07b48fa9
PE
21430 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
21431
8868a238 21432 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
21433 * window.c (window_loop, size_window):
21434 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 21435
7e5cf297 21436 * window.c (display_buffer): Now static.
d6550a9f
PE
21437 (size_window): Mark variables that gcc -Wuninitialized
21438 does not deduce are never used uninitialized.
a586633d
PE
21439 * window.h (check_all_windows): New decl, to forestall
21440 gcc -Wmissing-prototypes diagnostic.
5b555da1 21441 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 21442
f6095868
PE
21443 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
21444 shadowing.
21445 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
21446 Include <limits.h>.
21447 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
21448 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
21449 (load_charset_map): Mark variables that gcc -Wuninitialized
21450 does not deduce are never used uninitialized.
53df7c11 21451 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 21452
f38b440c
PE
21453 * coding.c (coding_set_source, coding_set_destination):
21454 Use "else { /* comment */ }" rather than "else /* comment */;"
21455 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
21456 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
21457 a block, when the outer 'i' will do.
21458 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
21459 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
21460 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
21461 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
21462 (Fdecode_sjis_char, Fdefine_coding_system_internal):
21463 Rename locals to avoid shadowing.
21464 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
21465 * coding.c (emacs_mule_char, encode_invocation_designation):
21466 Now static, since they're not used elsewhere.
413bb2db 21467 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 21468 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
21469 (decode_coding_emacs_mule): Mark variables that gcc
21470 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
21471 (detect_coding_iso_2022): Initialize a local variable that might
21472 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 21473 this initialization is needed. (Bug#8211)
5f58e762
PE
21474 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
21475 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
21476 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
21477 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
21478 Remove unused macros.
f38b440c 21479
232b38b9 21480 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 21481 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 21482 * character.c (string_count_byte8): Likewise.
232b38b9 21483
fb90da1b
PE
21484 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
21485 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
21486
fb93dbc2
PE
21487 * chartab.c (copy_sub_char_table): Now static, since it's not used
21488 elsewhere.
5c156ace
PE
21489 (sub_char_table_ref_and_range, char_table_ref_and_range):
21490 Rename locals to avoid shadowing.
bbcd0949 21491 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 21492
7d3b3862 21493 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 21494 (BIDI_BOB): Remove unused macro.
7d3b3862 21495
6be7d3da
PE
21496 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
21497 deduce are never used uninitialized.
c2ed9c8b 21498 * term.c (encode_terminal_code): Likewise.
6be7d3da 21499
75f8807f 21500 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 21501
50938595
PE
21502 * tparam.h: New file.
21503 * term.c, tparam.h: Include it.
21504 * deps.mk (term.o, tparam.o): Depend on tparam.h.
21505 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
21506 Move these decls to tparam.h, and make them agree with what
21507 is actually in tparam.c. The previous trick of using incompatible
21508 decls in different modules does not conform to the C standard.
21509 All callers of tparam changed to use tparam's actual API.
21510 * tparam.c (tparam1, tparam, tgoto):
21511 Use const pointers where appropriate.
21512
fbceeba2
PE
21513 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
21514 * cm.h (struct cm): Likewise.
21515 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
21516 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
21517 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
21518 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
21519 (turn_on_face, init_tty): Likewise.
21520 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 21521
7f3f1250
PE
21522 * term.c (term_mouse_position): Rename local to avoid shadowing.
21523
e6ca6543
PE
21524 * alloc.c (mark_ttys): Move decl from here ...
21525 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
21526
c40f8d15
AS
215272011-03-11 Andreas Schwab <schwab@linux-m68k.org>
21528
21529 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
21530
cfe0661d
JB
215312011-03-09 Juanma Barranquero <lekktu@gmail.com>
21532
21533 * search.c (compile_pattern_1): Remove argument regp, unused since
21534 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
21535 (compile_pattern): Don't pass it.
21536
0afb4571
J
215372011-03-08 Jan Djärv <jan.h.d@swipnet.se>
21538
21539 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
21540 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
21541 for ! HAVE_GTK3.
21542 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
21543
21544 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
21545
21546 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
21547 gdk_window_get_screen, gdk_window_get_geometry,
21548 gdk_x11_window_lookup_for_display and GDK_KEY_g.
21549 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
21550 (xg_get_pixbuf_from_pixmap): New function.
21551 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
21552 to Pixmap, take frame as parameter, remove GdkColormap parameter.
21553 Call xg_get_pixbuf_from_pixmap instead of
21554 gdk_pixbuf_get_from_drawable.
21555 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
21556 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
21557 (xg_check_special_colors): Use GtkStyleContext and its functions
21558 for HAVE_GTK3.
21559 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
21560 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
21561 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
21562 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
21563 Call gtk_widget_get_preferred_size.
0afb4571
J
21564 (xg_frame_resized): gdk_window_get_geometry only takes 5
21565 parameters.
44f230aa
SM
21566 (xg_win_to_widget, xg_event_is_for_menubar):
21567 Call gdk_x11_window_lookup_for_display.
0afb4571
J
21568 (xg_set_widget_bg): New function.
21569 (delete_cb): New function.
895009e1 21570 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 21571 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
21572 (xg_set_background_color): Call xg_set_widget_bg.
21573 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
21574 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
21575 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
21576 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
21577 if ! HAVE_GTK3.
21578 (update_frame_tool_bar): Call gtk_widget_hide.
21579 (xg_initialize): Use GDK_KEY_g.
21580
21581 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
21582 if ! HAVE_GTK3
21583 (x_session_initialize): Call gdk_x11_set_sm_client_id.
21584
21585 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
21586 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
21587 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
21588
1c2cc4ef
JB
215892011-03-08 Juanma Barranquero <lekktu@gmail.com>
21590
21591 * w32xfns.c (select_palette): Check success of RealizePalette against
21592 GDI_ERROR, not zero.
21593
33383987 21594See ChangeLog.11 for earlier changes.
aac0c6e3
MR
21595
21596;; Local Variables:
21597;; coding: utf-8
aac0c6e3
MR
21598;; End:
21599
ab422c4d 21600 Copyright (C) 2011-2013 Free Software Foundation, Inc.
aac0c6e3
MR
21601
21602 This file is part of GNU Emacs.
21603
21604 GNU Emacs is free software: you can redistribute it and/or modify
21605 it under the terms of the GNU General Public License as published by
21606 the Free Software Foundation, either version 3 of the License, or
21607 (at your option) any later version.
21608
21609 GNU Emacs is distributed in the hope that it will be useful,
21610 but WITHOUT ANY WARRANTY; without even the implied warranty of
21611 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21612 GNU General Public License for more details.
21613
21614 You should have received a copy of the GNU General Public License
21615 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.