ChangeLog 554 KB
Newer Older
1 2
2014-09-23  Paul Eggert  <eggert@cs.ucla.edu>

3 4 5 6 7
	* lisp.h (lispstpcpy): Rename from lispstrcpy, and act like stpcpy.
	All callers changed.
	* xterm.c (x_term_init): Use new functionality to avoid two needs
	to compute a string length.

8 9
	* dispextern.h, xdisp.c (window_box_right_offset): Now static.

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
2014-09-23  Dmitry Antipov  <dmantipov@yandex.ru>

	Use known length of a Lisp string to copy it faster.
	* lisp.h (lispstrcpy): New function.  Add comment.
	* callproc.c (child_setup):
	* dbusbind.c (xd_append_arg):
	* doc.c (get_doc_string):
	* font.c (Ffont_xlfd_name):
	* frame.c (xrdb_get_resource):
	* process.c (Fmake_network_process, network_interface_info):
	* w32fns.c (Fx_open_connection):
	* w32proc.c (sys_spawnve):
	* xfns.c (select_visual):
	* xfont.c (xfont_list):
	* xsmfns.c (x_session_initialize):
	* xterm.c (x_term_init): Use it.

27 28 29
2014-09-23  Paul Eggert  <eggert@cs.ucla.edu>

	Fix SAFE_ALLOCA to not exhaust the stack when in a loop.
30
	Problem reported by Dmitry Antipov in thread leading to:
31 32 33 34 35 36 37 38 39 40
	http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00713.html
	This patch fixes only SAFE_ALLOCA, SAFE_NALLOCA, and SAFE_ALLOCA_LISP;
	the experimental local_* macros enabled by USE_LOCAL_ALLOCATORS
	remain unfixed.
	* callproc.c (call_process): Save and restore sa_avail.
	* lisp.h (USE_SAFE_ALLOCA): Define sa_avail.
	(AVAIL_ALLOCA): New macro.
	(SAFE_ALLOCA, SAFE_NALLOCA, SAFE_ALLOCA_LISP):
	Use it, and check against sa_avail rather than MAX_ALLOCA.

41 42 43 44 45 46
2014-09-22  Dmitry Antipov  <dmantipov@yandex.ru>

	On OSX, do not free font-specific data more than once (Bug#18501).
	* macfont.m (macfont_close): Release and free font-specific data
	only if it wasn't previously freed.

Stefan Monnier's avatar
Stefan Monnier committed
47
2014-09-22  David Caldwell <david@porkrind.org> (tiny change)
48 49 50

	* unexmacosx.c (dump_it): Improve error message.

Stefan Monnier's avatar
Stefan Monnier committed
51
2014-09-22  Juri Linkov  <juri@jurta.org>
52 53 54 55

	* image.c (imagemagick_load_image): Add delay to imagemagick metadata.
	(Bug#10747, bug#18334)

Stefan Monnier's avatar
Stefan Monnier committed
56
2014-09-22  Eli Zaretskii  <eliz@gnu.org>
57

58 59 60
	* frame.c (Fmouse_position, Fset_mouse_position): Clarify the
	units in which the position is measured.  (Bug#18493)

61 62 63
	* xdisp.c (redisplay_internal): Force redisplay of all windows
	that show a buffer whose narrowing has changed.  (Bug#18490)

Stefan Monnier's avatar
Stefan Monnier committed
64
2014-09-22  Eli Zaretskii  <eliz@gnu.org>
65

66 67 68 69 70 71
	* xterm.c (x_draw_hollow_cursor, x_draw_bar_cursor):
	* w32term.c (x_draw_hollow_cursor, x_draw_bar_cursor): In R2L
	lines, draw the hollow-box and hbar cursors on the right side of
	cursor-glyph.  Thanks to martin rudalics <rudalics@gmx.at> for
	testing on X.

72 73 74 75 76 77
	* xterm.c (x_draw_stretch_glyph_string):
	* w32term.c (x_draw_stretch_glyph_string): Fix a thinko that
	caused the block cursor to disappear on a TAB in R2L lines in
	every window except the leftmost one.  Reported by Martin Rudalics
	<rudalics@gmx.at>.

Stefan Monnier's avatar
Stefan Monnier committed
78
2014-09-22  Dmitry Antipov  <dmantipov@yandex.ru>
79 80 81 82 83 84 85 86 87 88

	Always use matched specpdl entry to record call arguments (Bug#18473).
	* lisp.h (record_in_backtrace): Adjust prototype.
	* eval.c (record_in_backtrace): Return current specpdl level.
	(set_backtrace_args, set_backtrace_nargs): Merge.  Adjust all users.
	(eval_sub, Ffuncall): Record call arguments in matched specpdl
	entry and use that entry in call to backtrace_debug_on_exit.
	(apply_lambda): Likewise.  Get current specpdl level as 3rd arg.
	(do_debug_on_call): Get current specpdl level as 2nd arg.

89 90 91 92 93 94
	Prefer ptrdiff_t to int and avoid integer overflows.
	* fileio.c (make_temp_name):
	* font.c (font_parse_family_registry): Avoid integer
	overflow on string size calculation.
	* data.c (Faset): Likewise for byte index.

Stefan Monnier's avatar
Stefan Monnier committed
95
2014-09-22  Eli Zaretskii  <eliz@gnu.org>
96 97 98 99 100 101 102 103 104 105 106 107 108

	Fix display of R2L lines in partial-width windows.
	* xdisp.c (init_iterator): Don't use it->bidi_p before it is
	assigned the correct value.
	(extend_face_to_end_of_line): Account for truncation and
	continuation glyphs in R2L rows when one of the fringes is not
	displayed.
	(display_line): Don't assign negative X offset to a row if we are
	going to produce a truncation glyph for it.  When handling
	truncated R2L rows, consider the width of the left fringe instead
	of the right one.
	(produce_special_glyphs): Fix bogus assignments.

Stefan Monnier's avatar
Stefan Monnier committed
109 110 111 112
2014-09-22  Eli Zaretskii  <eliz@gnu.org>

	* w32.c (fcntl): Support O_NONBLOCK fcntl on the write side of pipes.

113 114 115 116 117 118
2014-09-22  Eli Zaretskii  <eliz@gnu.org>

	* fileio.c (Fexpand_file_name) [DOS_NT]: Make sure newdirlim is
	always set to a valid value.  Make sure the size passed to alloca
	is always positive.  (Bug#18516)

119 120 121 122 123 124 125 126 127
2014-09-22  Dmitry Antipov  <dmantipov@yandex.ru>

	Avoid extra call to oblookup when interning symbols.
	* lisp.h (intern_driver): Add prototype.
	* lread.c (intern_driver): New function.
	(intern1, intern_c_string_1, Fintern):
	* font.c (font_intern_prop):
	* w32font.c (intern_font_name): Use it.

128 129 130 131 132 133 134 135 136 137 138 139
2014-09-21  Paul Eggert  <eggert@cs.ucla.edu>

	Minor improvements to new stack-allocated Lisp objects.
	* frame.h (FRAME_PARAMETER):
	Prefer scoped_list1 to local_list1 where either would do.
	* lisp.h (scoped_list4): New macro.
	(local_cons, local_list1, local_list2, local_list3, local_list4)
	(make_local_vector, make_local_string, build_local_string):
	Prefer functions to macros where either would do.
	* xdisp.c (build_desired_tool_bar_string):
	Prefer scoped_list4 to local_list4 where either would do.

140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
2014-09-18  Dmitry Antipov  <dmantipov@yandex.ru>

	More and more stack-allocated Lisp objects if USE_LOCAL_ALLOCATORS.
	* lisp.h (local_list4) [USE_LOCAL_ALLOCATORS]: New macro.
	[!USE_LOCAL_ALLOCATORS]: Fall back to regular list4.
	* frame.h (FRAME_PARAMETER): New macro.
	* dispnew.c (init_display):
	* fontset.c (Fset_fontset_font):
	* frame.c (x_default_parameter):
	* xfaces.c (set_font_frame_param, Finternal_merge_in_global_face):
	* xfns.c (x_default_scroll_bar_color_parameter)
	(x_default_font_parameter, x_create_tip_frame): Use it.
	* editfns.c (Fpropertize): Use local_cons.
	* process.c (status_message): Use build_local_string.
	* xfont.c (xfont_open): Use make_local_string.
	* xdisp.c (build_desired_tool_bar_string): Use local_list4.

157 158 159
2014-09-18  Paul Eggert  <eggert@cs.ucla.edu>

	Port USE_LOCAL_ALLOCATORS code to clang 3.4 x86-64.
160 161 162
	* lisp.h (USE_LOCAL_ALLOCATORS): Define only if __GNUC__ &&
	!__clang__.  This works with GCC and with clang and is safer for
	compilers we don't know about.
163 164
	(local_cons): Rename parameter to make capture less likely.

165 166 167 168
2014-09-17  Samuel Bronson  <naesten@gmail.com>

	* unexmacosx.c (copy_data_segment): Port to GCC 4.6+ (Bug#9927).

169 170 171 172 173 174 175 176
2014-09-17  Paul Eggert  <eggert@cs.ucla.edu>

	Fix minor problems found by static checking.
	* alloc.c, lisp.h (SAVE_TYPE_INT_OBJ, make_save_int_obj):
	Remove; now unused.
	* buffer.h (decode_buffer): Doc and indentation fixes.
	* fns.c (Qstring_collate_lessp, Qstring_collate_equalp): Now static.

177 178 179 180 181 182
2014-09-17  Dmitry Antipov  <dmantipov@yandex.ru>

	Avoid clang-specific warnings.
	* buffer.c (init_buffer): Shut up -Wself-assign.
	* process.c (server_accept_connection): Shut up -Wunsequenced.

183 184 185 186
2014-09-16  Daniel Colascione  <dancol@dancol.org>

	* fns.c (sxhash): For symbols, use address as hash code.

187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
2014-09-16  Dmitry Antipov  <dmantipov@yandex.ru>

	If USE_LOCAL_ALLOCATORS, allocate even more Lisp objects on stack.
	* charset.c (load_charset_map_from_file): Use scoped_list2
	and build_local_string.
	* buffer.c (Fother_buffer, other_buffer_safely, init_buffer):
	* emacs.c (init_cmdargs, decode_env_path):
	* fileio.c (Fexpand_file_name):
	* fns.c (maybe_resize_hash_table) [ENABLE_CHECKING]:
	* frame.c (x_get_arg):
	* keyboard.c (safe_run_hooks_error):
	* lread.c (load_warn_old_style_backquotes):
	* xdisp.c (Fcurrent_bidi_paragraph_direction):
	* xfns.c (x_default_scroll_bar_color_parameter, select_visual):
	* xselect.c (x_clipboard_manager_error_1)
	(x_clipboard_manager_save_all):
	* xterm.c (x_term_init): Use build_local_string.

205 206 207 208 209
	Avoid more integer overflows on string size calculations.
	* category.c (Fmake_category_set):
	* xdisp.c (get_overlay_arrow_glyph_row):
	* w32font.c (intern_font_name): Prefer ptrdiff_t to int.

210 211 212 213 214 215 216 217
2014-09-15  Eli Zaretskii  <eliz@gnu.org>

	* sound.c [WINDOWSNT]: Include w32common.h and mbstring.h.
	(SOUND_WARNING) [WINDOWSNT]: Include in do..while and improve the
	error message format.  Use message_with_string to have non-ASCII
	file names properly displayed.
	(do_play_sound) [WINDOWSNT]: Use Unicode APIs to play sound files
	when w32-unicode-filenames is non-nil, but not on Windows 9X,
Stefan Monnier's avatar
Stefan Monnier committed
218 219
	where these APIs are not available even in UNICOWS.DLL.
	Improve the format of error messages and include the file name in them
220 221 222 223
	where appropriate.
	(Fplay_sound_internal) [WINDOWSNT]: Make the MS-Windows branch
	call play-sound-functions, per documentation.

Stefan Monnier's avatar
Stefan Monnier committed
224 225
	* w32.c (w32_get_long_filename, w32_get_short_filename):
	Constify the input file name arguments.
226

Stefan Monnier's avatar
Stefan Monnier committed
227 228
	* w32.h (w32_get_long_filename, w32_get_short_filename):
	Update prototypes.
229

230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263
2014-09-15  Dmitry Antipov  <dmantipov@yandex.ru>

	If USE_LOCAL_ALLOCATORS, allocate some Lisp objects on stack.
	* lisp.h (local_cons, local_list1, local_list2, local_list3)
	[USE_LOCAL_ALLOCATORS]: New macros.
	[!USE_LOCAL_ALLOCATORS]: Fall back to regular functions.
	(build_local_string): Avoid argument name expansion clash with
	make_local_string.
	* alloc.c (toplevel)
	[USE_LOCAL_ALLOCATORS && GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS]:
	Preprocessor guard to avoid impossible configuration.
	* charset.c (Ffind_charset_region, Ffind_charset_string):
	Use make_local_vector.
	* lread.c (read1, substitute_object_recurse): Use scoped_cons.
	* textprop.c (Fput_text_property, Fadd_face_text_property):
	Use scoped_list2.
	(copy_text_properties): Use local_cons and local_list3.
	* chartab.c (uniprop_table):
	* data.c (wrong_choice, wrong_range):
	* doc.c (get_doc_string):
	* editfns.c (format2):
	* fileio.c (Fexpand_file_name, auto_save_error):
	* fns.c (Fyes_or_no_p):
	* font.c (font_parse_xlfd, font_parse_family_registry, font_add_log):
	* fontset.c (Fset_fontset_font):
	* keyboard.c (echo_add_key, echo_dash, parse_menu_item)
	(read_char_minibuf_menu_prompt):
	* keymap.c (silly_event_symbol_error, describe_vector):
	* menu.c (single_menu_item):
	* minibuf.c (Fread_buffer):
	* process.c (status_message, Fformat_network_address)
	(server_accept_connection): Use make_local_string and
	build_local_string.  Prefer compound literals where appropriate.

Daniel Colascione's avatar
Daniel Colascione committed
264 265 266 267
2014-09-15  Daniel Colascione  <dancol@dancol.org>

	* fns.c (Fsort): Tweak sort docstring.

268
2014-09-15  Eli Zaretskii  <eliz@gnu.org>
269

270
	* w32.c (fcntl): Support O_NONBLOCK fcntl on the write side of pipes.
271 272 273 274 275
	(sys_write): When a write to a non-blocking pipe returns ENOSPC,
	set errno to EAGAIN instead, to allow the caller to retry the
	write after some waiting.  Fixes deadlocks when Emacs exchanges a
	lot of data through the pipe.  (Bug#18420)

276 277 278 279 280 281 282 283 284 285 286
	* sound.c (Fplay_sound_internal): Encode the sound file name in
	the ANSI codepage.  Expand it against data-directory, as per docs,
	not against the current directory.  No need to make a local copy
	of the file name; pass the encoded file name directly to
	do_play_sound.  (Bug#18463)

	* w32.c (ansi_encode_filename): If w32_get_short_filename returns
	NULL, and the file name is not encodable in ANSI codepage, return
	the string with "?" replacement characters, which will fail the
	caller.  This avoids returning a random value in that case.

287
2014-09-15  Martin Rudalics  <rudalics@gmx.at>
288 289 290 291

	* window.c (Fresize_mini_window_internal): Set w->total_lines
	from w->pixel_height (Bug#18422).

292
2014-09-15  Jan Djärv  <jan.h.d@swipnet.se>
293 294 295 296 297

	* nsterm.m (updateFrameSize:, initFrameFromEmacs:)
	(toggleFullScreen:): Take frame_resize_pixelwise into account when
	setting resize increments (Bug#18435).

298
2014-09-15  Eli Zaretskii  <eliz@gnu.org>
299 300 301 302 303 304

	* xdisp.c (pos_visible_p): Properly save and restore the iterator
	state around the call to line_bottom, since it can move the
	iterator to another screen line.  This fixes off-by-one errors in
	the reported row in some rare cases.

305 306 307 308 309
2014-09-14  Jan Djärv  <jan.h.d@swipnet.se>

	* callproc.c (init_callproc): Fix bug introduced at
	2014-09-07 (Bug#18474).

310 311 312 313 314 315 316 317
2014-09-13  Dmitry Antipov  <dmantipov@yandex.ru>

	Prefer ptrdiff_t to int and avoid integer overflows.
	* fileio.c (make_temp_name):
	* font.c (font_parse_family_registry): Avoid integer
	overflow on string size calculation.
	* data.c (Faset): Likewise for byte index.

318 319 320 321
2014-09-12  Detlev Zundel  <dzu@member.fsf.org>

	* buffer.c (syms_of_buffer): DEFSYM Qchoice (Bug#18337).

322 323 324 325 326
2014-09-11  Dmitry Antipov  <dmantipov@yandex.ru>

	* lisp.h (make_local_string): Nitpick indent.
	* print.c (Fprin1_to_string): Remove unused GCPROs.

327 328 329 330 331
	More debugging aids around GCPROs.
	* lisp.h (struct gcpro) [DEBUG_GCPRO]: Add extra members.
	(GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, GCPRO7):
	Minor restyle.  If DEBUG_GCPRO, initialize extra fields.

332 333 334
	* lread.c (readevalloop_eager_expand_eval): Add GCPRO and fix
	bootstrap broken if GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.

Stefan Monnier's avatar
Stefan Monnier committed
335 336
	Remove redundant GCPROs around Ffuncall and Fapply calls.
	This is safe because Ffuncall protects all of its arguments by itself.
337 338 339 340 341
	* charset.c (map_charset_for_dump): Remove redundant GCPRO.
	* eval.c (Fapply, apply1, call0, call1, call2, call3, call4, call5)
	(call6, call7): Likewise.  Use compound literals where applicable.
	(run_hook_with_args_2): Use compound literal.

342 343 344 345 346 347 348 349 350 351 352 353 354 355 356
2014-09-11  Paul Eggert  <eggert@cs.ucla.edu>

	Pacify --enable-gcc-warnings when no window system is used.
	These warnings found that subscript error, so they seem worthwhile.
	* composite.c (char_composable_p): Simplify a bit.
	* frame.c (x_set_frame_parameters): Add an IF_LINT.
	* frame.c (x_set_horizontal_scroll_bars, x_set_scroll_bar_height):
	* frame.h (FRAME_HAS_HORIZONTAL_SCROLL_BARS):
	* window.c (set_window_scroll_bars):
	Use USE_HORIZONTAL_SCROLL_BARS for simplicity.
	* frame.h [! USE_HORIZONTAL_SCROLL_BARS]:
	Ignore -Wsuggest-attribute=const.
	* window.h (USE_HORIZONTAL_SCROLL_BARS): New macro.
	(WINDOW_HAS_HORIZONTAL_SCROLL_BAR): Use it.

357 358 359 360 361 362 363
2014-09-10  Paul Eggert  <eggert@penguin.cs.ucla.edu>

	* charset.c (Fget_unused_iso_final_char): Fix subscript error.
	Use check_iso_charset_parameter instead of doing the checks by hand.
	(check_iso_charset_parameter): Move up.  Check parameters a bit
	more carefully, and return true for 96-char sets.  All callers changed.

364 365 366 367 368 369 370 371 372 373
2014-09-10  Paul Eggert  <eggert@cs.ucla.edu>

	Simplify lisp.h by removing the __COUNTER__ business.
	Problem reported by Dmitry Antipov in:
	http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00220.html
	* lisp.h (make_local_vector, make_local_string)
	(build_local_string): Simplify by not bothering with __COUNTER__.
	The __COUNTER__ business wasn't working properly, and was needed
	only for hypothetical future expansion anyway.

374 375 376 377 378
2014-09-10  Alp Aker  <alp.tekin.aker@gmail.com>

	* nsterm.m (ns_draw_fringe_bitmap): Use the same logic as other
	terms to determine bitmap color.  (Bug#18437)

379 380 381 382 383
2014-09-10  Eli Zaretskii  <eliz@gnu.org>

	* w32.c (sys_write): Use SAFE_NALLOCA for the NL -> CRLF
	translation buffer.

384 385 386 387
2014-09-10  Paul Eggert  <eggert@cs.ucla.edu>

	* xterm.c (handle_one_xevent): Add braces to pacify gcc -Wall.

388 389 390 391 392
2014-09-10  Jan Djärv  <jan.h.d@swipnet.se>

	* xterm.c (handle_one_xevent): Detect iconified by looking at
	_NET_WM_STATE_HIDDEN.

393 394
2014-09-10  Paul Eggert  <eggert@cs.ucla.edu>

395 396 397 398 399 400 401 402 403 404
	* lisp.h (DEFINE_GDB_SYMBOL_ENUM): Remove.
	These can generate a constant with the correct value but the wrong
	width, which doesn't work as a printf argument.  All uses removed.
	Problem reported by Dmitry Antipov in:
	http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00213.html
	(ENUMABLE): Remove; no longer needed.
	(ARRAY_MARK_FLAG_val, PSEUDOVECTOR_FLAG_val, VALMASK_val):
	Remove; no longer needed because of the above change.
	Each definiens moved to the only use.

405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429
	Improve the experimental local and scoped allocation.
	* alloc.c (local_string_init, local_vector_init):
	New functions, defined if USE_LOCAL_ALLOCATORS.
	Mostly, these are moved here from lisp.h, as it's not
	clear it's worth making them inline.
	* lisp.h (USE_STACK_LISP_OBJECTS): Default to false.
	(GCALIGNED): Depend on HAVE_STRUCT_ATTRIBUTE_ALIGNED and
	USE_STACK_LISP_OBJECTS, not on a laundry list.
	(local_string_init, local_vector_init): New decls.
	(union Aligned_Cons): New type.
	(scoped_cons): Use it.  Give up on the char trick, as it's a too
	much of a maintenance hassle; if someone wants this speedup
	they'll just need to convince their compiler to align properly.
	Conversely, use the speedup if struct Lisp_Cons happens to
	be aligned even without a directive.  Better yet, help it along
	by using union Aligned_Cons rather than struct Lisp_Cons.
	(pointer_valid_for_lisp_object): Remove.  This check is not
	necessary, since make_lisp_ptr is already doing it.  All uses removed.
	(local_vector_init, local_string_init): Move to alloc.c.
	(build_local_vector): Remove this awkward macro, replacing with ...
	(make_local_vector): New macro, which acts more like a function.
	Use statement expressions and use __COUNTER__ to avoid macro
	capture.  Fall back on functions if these features are not supported.
	(build_local_string, make_local_string): Likewise.

430 431 432 433 434 435 436
2014-09-09  Dmitry Antipov  <dmantipov@yandex.ru>

	* xterm.c (x_term_init): Consolidate duplicated code.
	[USE_LUCID]: Revert 2014-04-02 change (Bug#18403).  Add comment.
	(x_delete_terminal): Do not close X connection fd (Bug#18403).
	Add eassert and mark dpyinfo as dead only if it was alive.

437 438 439 440 441 442 443 444 445 446 447 448
	Add macros to allocate temporary Lisp objects with alloca.
	Respect MAX_ALLOCA and fall back to regular GC for large objects.
	* character.h (parse_str_as_multibyte): Move prototype to ...
	* lisp.h (parse_str_as_multibyte): ... here.
	(struct Lisp_Cons): Add GCALIGNED attribute if supported.
	(scoped_cons, scoped_list2, build_local_vector, build_local_string):
	New macros.
	(scoped_cons_init, pointer_valid_for_lisp_object, local_vector_init)
	(local_string_init): New functions.
	* alloc.c (verify_alloca) [ENABLE_CHECKING]: New function.
	(init_alloc_once): Call it.

449 450 451 452 453 454 455 456 457
	Cleanup last change and make all new stuff conditional.
	* lisp.h (build_local_string): Rename to ...
	(make_local_string): ... this macro.
	(build_local_string, scoped_list1, scoped_list3): New macros.
	(toplevel) [USE_STACK_LISP_OBJECTS]: Define all new macros
	and functions as such, use regular fallbacks otherwise.
	* alloc.c (verify_alloca) [USE_STACK_LISP_OBJECTS]: Define
	conditionally.

458
2014-09-08  Eli Zaretskii  <eliz@gnu.org>
459 460 461 462 463

	* dispnew.c (prepare_desired_row): When MODE_LINE_P is zero,
	always make sure the marginal areas of the row are in sync with
	what the window wants.  (Bug#18419)

464 465 466 467
	* data.c (set_internal): Use assq_no_quit, not Fassq, to find an
	existing binding of a variable, to avoid silently aborting
	commands that use specbind.  (Bug#18331)

468 469
2014-09-07  Paul Eggert  <eggert@cs.ucla.edu>

470 471 472 473 474 475 476 477 478 479
	Fix bug uncovered by changing alloca to auto buffer (Bug#18410).
	* coding.c (growable_destination): New function.
	(produce_chars): Use it for sanity checks.  Do not fiddle with
	dst_end if the source and destination are both nil, as it's
	the caller's responsibility to avoid overlap.
	* keyboard.c (read_decoded_event_from_main_queue):
	The destination must be MAX_MULTIBYTE_LENGTH times the max source
	length, not 4 times, to prevent decode_coding_c_string from trying
	to reallocate a destination.  This removes the need for the FIXME.

480 481 482 483
	* callproc.c (exec_failed) [DOS_NT]: Define a dummy.
	All callers simplified.  Add a comment about exec_failed, vfork,
	and alloca.

484 485 486 487 488
	Adjust drag-and-drop fix when window is above top (Bug#18303).
	* xselect.c (x_fill_property_data): Don't let sign bit of negative
	XCDR bleed into XCAR's encoded value.  Improve checks for
	out-of-range data while we're at it.

489 490 491 492 493
2014-09-07  Jan Djärv  <jan.h.d@swipnet.se>

	* xselect.c (x_fill_property_data): Handle negative XCDR when data
	is CONSP (Bug#18303).

494 495 496 497 498 499 500
2014-09-07  Eli Zaretskii  <eliz@gnu.org>

	* callproc.c (child_setup) [WINDOWSNT]: Don't call exec_failed if
	'alloca' gets passed arguments larger than MAX_ALLOCA.

	* font.c (MAX): Define if not defined elsewhere.

501 502
2014-09-07  Paul Eggert  <eggert@cs.ucla.edu>

503 504 505 506 507
	* keyboard.c (read_decoded_event_from_main_queue): Reinstitute alloca
	here for destination buffer, to work around what appears to be a
	bug in decode_coding_c_string when the source and destination are
	both C strings.

508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531
	Use SAFE_ALLOCA etc. to avoid unbounded stack allocation (Bug#18410).
	This follows up on the recent thread in emacs-devel on alloca; see:
	http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00042.html
	This patch also cleans up alloca-related glitches noted while
	examining the code looking for unbounded alloca.
	* alloc.c (listn):
	* callproc.c (init_callproc):
	Rewrite to avoid need for alloca.
	* buffer.c (mouse_face_overlay_overlaps)
	(report_overlay_modification):
	* buffer.h (GET_OVERLAYS_AT):
	* coding.c (make_subsidiaries):
	* doc.c (Fsnarf_documentation):
	* editfns.c (Fuser_full_name):
	* fileio.c (Ffile_name_directory, Fexpand_file_name)
	(search_embedded_absfilename, Fsubstitute_in_file_name):
	* fns.c (Fmake_hash_table):
	* font.c (font_vconcat_entity_vectors, font_update_drivers):
	* fontset.c (fontset_pattern_regexp, Ffontset_info):
	* frame.c (Fmake_terminal_frame, x_set_frame_parameters)
	(xrdb_get_resource, x_get_resource_string):
	* ftfont.c (ftfont_get_charset, ftfont_check_otf, ftfont_drive_otf):
	* ftxfont.c (ftxfont_draw):
	* image.c (xbm_load, xpm_load, jpeg_load_body):
532 533
	* keyboard.c (echo_add_key, menu_bar_items, tool_bar_items)

534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604
	* keymap.c (Fdescribe_buffer_bindings, describe_map):
	* lread.c (openp):
	* menu.c (digest_single_submenu, find_and_call_menu_selection)
	(find_and_return_menu_selection):
	* print.c (PRINTFINISH):
	* process.c (Fformat_network_address):
	* scroll.c (do_scrolling, do_direct_scrolling, scrolling_1):
	* search.c (search_buffer, Fmatch_data, Fregexp_quote):
	* sound.c (wav_play, au_play):
	* syntax.c (skip_chars):
	* term.c (tty_menu_activate, tty_menu_show):
	* textprop.c (get_char_property_and_overlay):
	* window.c (Fset_window_configuration):
	* xdisp.c (safe__call, next_overlay_change, vmessage)
	(compute_overhangs_and_x, draw_glyphs, note_mouse_highlight):
	* xfaces.c (face_at_buffer_position):
	* xmenu.c (x_menu_show):
	Use SAFE_ALLOCA etc. instead of plain alloca, since the
	allocation size isn't bounded.
	* callint.c (Fcall_interactively): Redo memory_full check
	so that it can be done at compile-time on some platforms.
	* coding.c (MAX_LOOKUP_MAX): New constant.
	(get_translation_table): Use it.
	* callproc.c (call_process): Use SAFE_NALLOCA instead of
	SAFE_ALLOCA, to catch integer overflows on size calculation.
	(exec_failed) [!DOS_NT]: New function.
	(child_setup) [!DOS_NT]: Use it.
	* editfns.c (Ftranspose_regions):
	Hoist USE_SAFE_ALLOC + SAFE_FREE out of 'if'.
	* editfns.c (check_translation):
	Allocate larger buffers on the heap.
	* eval.c (internal_lisp_condition_case):
	Check for MAX_ALLOCA overflow.
	* fns.c (sort_vector): Use SAFE_ALLOCA_LISP rather than Fmake_vector.
	(Fbase64_encode_region, Fbase64_decode_region):
	Avoid unnecessary calls to SAFE_FREE before 'error'.
	* buffer.c (mouse_face_overlay_overlaps):
	* editfns.c (Fget_pos_property, check_translation):
	* eval.c (Ffuncall):
	* font.c (font_unparse_xlfd, font_find_for_lface):
	* ftfont.c (ftfont_drive_otf):
	* keyboard.c (echo_add_key, read_decoded_event_from_main_queue)
	(menu_bar_items, tool_bar_items):
	* sound.c (Fplay_sound_internal):
	* xdisp.c (load_overlay_strings, dump_glyph_row):
	Use an ordinary auto buffer rather than alloca, since the
	allocation size is fixed and small.
	* ftfont.c: Include <c-strcase.h>.
	(matching_prefix): New function.
	(get_adstyle_property): Use it, to avoid need for alloca.
	* keyboard.c (echo_add_key):
	* keymap.c (describe_map): Use ptrdiff_t, not int.
	* keyboard.c (echo_add_key): Prefer sizeof to strlen.
	* keymap.c (Fdescribe_buffer_bindings): Use SBYTES, not SCHARS,
	when counting bytes.
	* lisp.h (xlispstrdupa): Remove, replacing with ...
	(SAFE_ALLOCA_STRING): ... new macro with different API.
	This fixes a portability problem, namely, alloca result
	passed to another function.  All uses changed.
	(SAFE_ALLOCA, SAFE_ALLOCA_LISP): Check for MAX_ALLOCA,
	not MAX_ALLOCA - 1.
	* regex.c (REGEX_USE_SAFE_ALLOCA, REGEX_SAFE_FREE)
	(REGEX_ALLOCATE): New macros.
	(REGEX_REALLOCATE, REGEX_ALLOCATE_STACK, REGEX_REALLOCATE_STACK)
	(REGEX_FREE_STACK, FREE_VARIABLES, re_match_2_internal):
	Use them.
	* xdisp.c (message3): Use SAFE_ALLOCA_STRING rather than doing it
	by hand.
	(decode_mode_spec_coding): Store directly into buf rather than
	into an alloca temporary and copying the temporary to the buf.

605 606 607 608
2014-09-06  Eli Zaretskii  <eliz@gnu.org>

	* Makefile.in (EMACS_HEAPSIZE): Remove, no longer used.  (Bug#18416)

Jan Djärv's avatar
Jan Djärv committed
609 610 611 612 613 614 615
2014-09-04  Jan D  <jhd@f20.localdomain>

	* xterm.c (x_term_init): Don't call x_session_initialize if running
	as a daemon (Bug#18375).

	* xsmfns.c: Initialize ice_fd.

Paul Eggert's avatar
Paul Eggert committed
616 617 618 619 620 621 622
2014-09-04  Paul Eggert  <eggert@cs.ucla.edu>

	Less chatter in 'make' output.
	* Makefile.in (AM_V_GEN, am__v_GEN_, am__v_GEN_0, am__v_GEN_1, AM_V_at)
	(am__v_at_, am__v_at_0, am__v_at_1):  New macros, taken from Automake.
	($(etc)/DOC, buildobj.h, gl-stamp): Use them.

623 624 625
2014-09-03  Martin Rudalics  <rudalics@gmx.at>

	* buffer.c (scroll-bar-height): Fix typo in doc-string.
Stefan Monnier's avatar
Stefan Monnier committed
626 627
	* frame.c (Vdefault_frame_horizontal_scroll_bars):
	Remove variable.
628 629 630 631 632
	* nsfns.m (Fx_create_frame):
	* w32fns.c (Fx_create_frame):
	* xfns.c (Fx_create_frame): Default horizontal scroll bars to
	nil.

633
2014-09-03  Eli Zaretskii  <eliz@gnu.org>
634 635 636 637 638 639

	* dispnew.c (buffer_posn_from_coords): Fix an off-by-one error in
	the reported row in the case of a window with a header line, by
	improving on the fix committed in 2011-10-08T10:58:50Z!eliz@gnu.org
	eliz@gnu.org-20111008105850-ht4tvsayohvr1kjc.  (Bug#18384)

640
2014-09-03  Paul Eggert  <eggert@cs.ucla.edu>
641 642 643 644

	* eval.c (internal_lisp_condition_case): Don't overrun the stack
	when configured --with-wide-int on typical 32-bit platforms.

645
2014-09-03  Eli Zaretskii  <eliz@gnu.org>
646 647 648 649 650

	* xdisp.c (display_and_set_cursor): Call erase_phys_cursor also
	when HPOS is negative, for the benefit of R2L glyph rows whose
	newline overflows into the fringe.

651
2014-09-03  Ken Brown  <kbrown@cornell.edu>
652

653
	* conf_post.h (strnicmp) [CYGWIN && HAVE_NTGUI]: Define.  (Bug#18366)
654

655 656 657 658 659 660 661 662
2014-09-02  Paul Eggert  <eggert@cs.ucla.edu>

	Minor cleanup of recent strlen-avoiding patch.
	* fileio.c (CHECK_LENGTH): Remove.
	Rewrite callers so that they don't need it.
	(Fexpand_file_name) [DOS_NT]: Fix a case where directory length
	variable wasn't set.

663 664 665 666 667
2014-09-02  Dmitry Antipov  <dmantipov@yandex.ru>

	* fileio.c (CHECK_LENGTH): New macro.
	(Fexpand_file_name): Use it and get rid of a few more calls
	to strlen and strcat.
668 669 670
	* callproc.c (egetenv_internal): Add arg and rename from egetenv ...
	* lisp.h (egetenv): ... because of a new inline function used to
	avoid calls to strlen for a compile-time constants.
671

672 673 674 675 676 677 678 679
	* buffer.h (decode_buffer): New function.
	* buffer.c (Fbuffer_name, Fbuffer_file_name, Fbuffer_base_buffer)
	(Fbuffer_local_variables, Fbuffer_modified_p, Fbuffer_modified_tick)
	(Fbuffer_chars_modified_tick, Fdelete_all_overlays):
	* data.c (Flocal_variables_p):
	* fileio.c (Fverify_visited_file_modtime):
	* marker.c (live_buffer): Use it.

680 681 682 683 684 685 686 687 688 689 690 691 692
2014-09-01  Dmitry Antipov  <dmantipov@yandex.ru>

	Avoid extra calls to strlen in filesystem I/O routines.
	* fileio.c (Fexpand_file_name): Avoid calls to strlen if
	the length of 'newdir' is known or may be precalculated.
	(file_accessible_directory_p): Prefer to pass Lisp_Object,
	not 'char *', and so use precalculated length.
	(Ffile_accessible_directory_p):
	* callproc.c (encode_current_directory, init_callproc):
	* charset.c (init_charset):
	* lread.c (load_path_check, load_path_default): Adjust users.
	* lisp.h (file_accessible_directory_p): Tweak prototype.

693 694 695 696 697
2014-09-01  Eli Zaretskii  <eliz@gnu.org>

	* w32proc.c (w32_compare_strings): Support "C" and "POSIX"
	locales.

Paul Eggert's avatar
Paul Eggert committed
698 699
2014-09-01  Paul Eggert  <eggert@cs.ucla.edu>

700
	--enable-silent-rules now suppresses more chatter.
701 702 703 704 705
	* Makefile.in (AM_DEFAULT_VERBOSITY, AM_V_CC, am__v_CC_)
	(am__v_CC_0, am__v_CC_1, AM_V_CCLD, am__v_CCLD_, am__v_CCLD_0)
	(am__v_CCLD_1): New macros, taken from Automake.
	(.c.o, .m.o, temacs$(EXEEXT)): Use them.

Paul Eggert's avatar
Paul Eggert committed
706 707 708 709 710 711 712 713 714 715 716 717 718 719
	Clean up extern decls a bit.
	* bytecode.c: Include blockinput.h and keyboard.h rather
	than rolling their APIs by hand.
	* emacs.c: Include regex.h and rely on its and lisp.h's API
	rather than rolling them by hand.
	* lastfile.c: Include lisp.h, to check this file's API.
	* lisp.h (lisp_eval_depth, my_edata, my_endbss, my_endbss_static):
	New decls.
	* regex.h (re_max_failures): New decl.
	* unexcw.c, unexmacosx.c, unexw32.c:
	Rely on lisp.h's API rather than rolling it by hand.
	* vm-limit.c (__after_morecore_hook, __morecore, real_morecore):
	Declare at top level, to pacify GCC -Wnested-externs.

720 721 722 723 724 725 726 727 728
2014-08-31  Eli Zaretskii  <eliz@gnu.org>

	* xdisp.c (get_glyph_string_clip_rects): Don't let the width of a
	clipping rectangle become negative (i.e. large positive, since
	it's an unsigned data type).  This can happen in R2L hscrolled
	glyph rows, and caused us to draw the cursor glyph on the fringe.
	For the details, see
	http://lists.gnu.org/archive/html/emacs-devel/2014-08/msg00543.html.

729 730 731 732 733 734
2014-08-31  Ken Brown  <kbrown@cornell.edu>

	* gmalloc.c: Don't include <stdlib.h>.  Declare system malloc and
	friends before defining hybrid_malloc and friends if HYBRID_MALLOC
	is defined.  (Bug#18368)

735 736
2014-08-30  Paul Eggert  <eggert@cs.ucla.edu>

Paul Eggert's avatar
Paul Eggert committed
737 738 739 740 741 742 743 744 745 746 747 748 749 750
	Vector-sorting fixes (Bug#18361).
	It's not safe to call qsort or qsort_r, since they have undefined
	behavior if the user-specified predicate is not a total order.
	Also, watch out for garbage-collection while sorting vectors.
	* fns.c: Include <vla.h>.
	(sort_vector_predicate) [!HAVE_QSORT_R]: Remove.
	(sort_vector_compare): Remove, replacing with ....
	(inorder, merge_vectors, sort_vector_inplace, sort_vector_copy):
	... these new functions.
	(sort_vector): Rewrite to use the new functions.
	GCPRO locals, since the predicate can invoke the GC.
	Since it's in-place return void; caller changed.
	(merge): Use 'inorder', for clarity.

751 752 753 754
	* sysdep.c (str_collate): Clear errno just before wcscoll(_l).
	One can't hoist this out of the 'if', because intervening calls to
	newlocale, twolower, etc. can change errno.

755 756 757 758 759 760 761 762 763 764 765 766
2014-08-30  Eli Zaretskii  <eliz@gnu.org>

	* sysdep.c (str_collate) [__STDC_ISO_10646__]: Improve the
	wording of the error messages.
	(str_collate) [WINDOWSNT]: Signal an error if w32_compare_strings
	sets errno.

	* w32proc.c (get_lcid_callback): Accept locale specifications
	without the country part, as in "enu" vs "enu_USA".
	(w32_compare_strings): Signal an error if a locale was specified,
	but couldn't be translated into a valid LCID.

767 768 769 770
2014-08-29  Michael Albinus  <michael.albinus@gmx.de>

	* sysdep.c (str_collate) [__STDC_ISO_10646__]: Move up setting errno.

771 772
2014-08-29  Paul Eggert  <eggert@cs.ucla.edu>

773 774 775 776
	* sysdep.c (str_collate) [__STDC_ISO_10646__]: Do not look at
	errno after towlower_l.  errno's value is not specified after
	towlower_l.  Instead, assume that towlower_l returns its argument
	on failure, which is portable in practice.
777

778 779 780 781 782 783 784 785 786 787 788 789 790 791
2014-08-29  Eli Zaretskii  <eliz@gnu.org>

	* fns.c (Fstring_collate_lessp, Fstring_collate_equalp): Doc fix.

	* w32proc.c (w32_compare_strings): Accept additional argument
	IGNORE_CASE.  Set up the flags for CompareStringW to ignore case
	if requested.  If w32-collate-ignore-punctuation is non-nil, add
	NORM_IGNORESYMBOLS to the flags.
	(LINGUISTIC_IGNORECASE): Define if not already defined.
	(syms_of_ntproc) <Vw32_collate_ignore_punctuation>: New variable.

	* sysdep.c (str_collate) [WINDOWSNT]: Adapt to the interface
	change.

792 793 794 795 796 797 798 799 800 801 802
2014-08-29  Michael Albinus  <michael.albinus@gmx.de>

	* sysdep.c (LC_CTYPE, LC_CTYPE_MASK, towlower_l):
	Define substitutes for platforms that lack them.
	(str_collate): Add arguments locale and ignore_case.

	* fns.c (Fstring_collate_lessp, Fstring_collate_equalp):
	Add optional arguments LOCALE and IGNORE-CASE.

	* lisp.h (str_collate): Adapt argument list.

Dmitry Antipov's avatar
Dmitry Antipov committed
803 804 805 806 807 808 809 810 811 812 813
2014-08-29  Dmitry Antipov  <dmantipov@yandex.ru>

	Add vectors support to Fsort.
	* fns.c (sort_vector, sort_vector_compare): New functions.
	(sort_list): Likewise, refactored out of ...
	(Fsort): ... adjusted user.  Mention vectors in docstring.
	(sort_vector_predicate) [!HAVE_QSORT_R]: New variable.
	* alloc.c (make_save_int_obj): New function.
	* lisp.h (enum Lisp_Save_Type): New member SAVE_TYPE_INT_OBJ.
	(make_save_int_obj): Add prototype.

Dmitry Antipov's avatar
Dmitry Antipov committed
814
	Fix last change to support Darwin/OSX and FreeBSD (Bug#18354).
815 816 817 818
	* sysdep.c (sort_vector_compare) [DARWIN_OS || __FreeBSD__]:
	Conditionally define to match system's qsort_r signature.
	(sort_vector) [DARWIN_OS || __FreeBSD__]: Likewise in call to qsort_r.

819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862
2014-08-28  Ken Brown  <kbrown@cornell.edu>

	Add support for HYBRID_MALLOC, allowing the use of gmalloc before
	dumping and the system malloc after dumping.  (Bug#18222)

	* conf_post.h (malloc, realloc, calloc, free) [HYBRID_MALLOC]:
	Define as macros, expanding to hybrid_malloc, etc.
	(HYBRID_GET_CURRENT_DIR_NAME): New macro.
	(get_current_dir_name) [HYBRID_GET_CURRENT_DIR_NAME]: Define as
	macro.
	* gmalloc.c: Set up the infrastructure for HYBRID_MALLOC, with a
	full implementation on Cygwin.  Remove Cygwin-specific code that
	is no longer needed.
	(malloc, realloc, calloc, free, aligned_alloc) [HYBRID_MALLOC]:
	Redefine as macros expanding to gmalloc, grealloc, etc.
	(DUMPED, ALLOCATED_BEFORE_DUMPING) [CYGWIN]: New macros.
	(get_current_dir_name) [HYBRID_GET_CURRENT_DIR_NAME]: Undefine.
	(USE_PTHREAD, posix_memalign) [HYBRID_MALLOC]: Don't define.
	(hybrid_malloc, hybrid_calloc, hybrid_free, hybrid_realloc)
	[HYBRID_MALLOC]:
	(hybrid_get_current_dir_name) [HYBRID_GET_CURRENT_DIR_NAME]:
	(hybrid_aligned_alloc) [HYBRID_MALLOC && (HAVE_ALIGNED_ALLOC ||
	HAVE_POSIX_MEMALIGN)]: New functions.
	* alloc.c (aligned_alloc) [HYBRID_MALLOC && (ALIGNED_ALLOC ||
	HAVE_POSIX_MEMALIGN)]: Define as macro expanding to
	hybrid_aligned_alloc; declare.
	(USE_ALIGNED_ALLOC) [HYBRID_MALLOC && (ALIGNED_ALLOC ||
	HAVE_POSIX_MEMALIGN)]: Define.
	(refill_memory_reserve) [HYBRID_MALLOC]: Do nothing.
	* sysdep.c (get_current_dir_name) [HYBRID_GET_CURRENT_DIR_NAME]:
	Define as macro, expanding to gget_current_dir_name, and define
	the latter.
	* emacs.c (main) [HYBRID_MALLOC]: Don't call memory_warnings() or
	malloc_enable_thread().  Don't initialize malloc.
	* lisp.h (NONPOINTER_BITS) [CYGWIN]: Define (because GNU_MALLOC is
	no longer defined on Cygwin).
	(refill_memory_reserve) [HYBRID_MALLOC]: Don't declare.
	* sheap.c (bss_sbrk_buffer_end): New variable.
	* unexcw.c (__malloc_initialized): Remove variable.
	* ralloc.c: Throughout, treat HYBRID_MALLOC the same as
	SYSTEM_MALLOC.
	* xdisp.c (decode_mode_spec) [HYBRID_MALLOC]: Don't check
	Vmemory_full.

863 864
2014-08-28  Martin Rudalics  <rudalics@gmx.at>

Stefan Monnier's avatar
Stefan Monnier committed
865 866
	* w32term.c (w32_horizontal_scroll_bar_handle_click):
	In `event->y' return entire range (the size of the scroll bar minus
867 868 869 870 871 872 873 874 875 876
	that of the thumb).
	* xterm.c (xm_scroll_callback, xaw_jump_callback): In `whole'
	return entire range (the scaled size of the scroll bar minus
	that of the slider).  In `portion' return the scaled position of
	the slider.
	(xaw_jump_callback): Restore part of code for vertical scroll
	bar broken in change from 2014-07-27.
	(xaw_scroll_callback): Provide incremental scrolling with
	horizontal scroll bars.

877
2014-08-28  Eli Zaretskii  <eliz@gnu.org>
878 879 880

	* conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Don't define.

881 882 883
	* indent.c (Fvertical_motion): Fix vertical motion up through a
	display property after a newline.  (Bug#18276)

884 885
	* xdisp.c (display_line): Don't assume that the call to
	reseat_at_next_visible_line_start ends up at a character
Stefan Monnier's avatar
Stefan Monnier committed
886 887
	immediately following the newline on the previous line.
	Avoids setting the ends_at_zv_p flag on screen lines that are not at or
888 889 890
	beyond ZV, which causes infloop in redisplay.  For the details, see
	http://lists.gnu.org/archive/html/emacs-devel/2014-08/msg00368.html.

891 892 893
	* dispnew.c (buffer_posn_from_coords): Fix mirroring of X
	coordinate for hscrolled R2L screen lines.  (Bug#18277)

894 895 896 897 898
2014-08-28  Paul Eggert  <eggert@cs.ucla.edu>

	* sysdep.c (LC_COLLATE, LC_COLLATE_MASK): Give individual defaults
	(Bug#18051).

899 900 901 902 903
2014-08-27  Eli Zaretskii  <eliz@gnu.org>

	* syntax.c (scan_lists): Don't examine positions before BEGV.
	(Bug#18339)

904 905 906 907 908 909 910
2014-08-27  Paul Eggert  <eggert@cs.ucla.edu>

	Improve robustness of new string-collation code (Bug#18051).
	* sysdep.c (LC_COLLATE, LC_COLLATE_MASK, freelocale, locale_t)
	(newlocale, wcscoll_l): Define substitutes for platforms that
	lack them, so as to simplify the mainline code.
	(str_collate): Simplify the code by assuming the above definitions.
Stefan Monnier's avatar
Stefan Monnier committed
911 912
	Use wcscoll_l, not uselocale, as uselocale is too fragile.
	For example, the old version left the Emacs in the wrong locale if
913 914 915
	wcscoll reported an error.  Use 'int', not ptrdiff_t, for the int
	result.  Report an error if newlocale fails.

Michael Albinus's avatar
Michael Albinus committed
916 917 918 919 920 921
2014-08-27  Michael Albinus  <michael.albinus@gmx.de>

	* lisp.h (str_collate):
	* sysdep.c (str_collate): Return int.
	(str_collate) [__STDC_ISO_10646__]: Propagate error of wcscoll.

922 923 924 925 926 927 928 929
2014-08-27  Dmitry Antipov  <dmantipov@yandex.ru>

	Fix some glitches in previous change.
	* sysdep.c (stack_direction): Replace stack_grows_down
	to simplify calculation of stack boundaries.
	(handle_sigsegv): Check whether we really crash somewhere near
	to stack boundary, and handle fatal signal as usual if not.
	(init_sigsegv): Adjust accordingly.
930 931 932 933
	* keyboard.c (Vtop_level_message): Rename to
	Vinternal__top_level_message, as suggested by Stefan Monnier in
	http://lists.gnu.org/archive/html/emacs-devel/2014-08/msg00493.html
	All related users changed.
934

935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953
2014-08-26  Dmitry Antipov  <dmantipov@yandex.ru>

	Handle C stack overflow caused by too nested Lisp evaluation.
	* lisp.h (toplevel) [HAVE_STACK_OVERFLOW_HANDLING]: Declare
	siglongjmp point to transfer control from SIGSEGV handler.
	* keyboard.c (return_to_command_loop, recover_top_level_message)
	[HAVE_STACK_OVERFLOW_HANDLING]: New variables.
	(regular_top_level_message): New variable.
	(command_loop) [HAVE_STACK_OVERFLOW_HANDLING]: Handle non-local
	exit from SIGSEGV handler and adjust message displayed by Vtop_level
	if appropriate.
	(syms_of_keyboard): DEFVAR Vtop_level_message and initialize
	new variables described above.
	* sysdep.c [HAVE_SYS_RESOURCE_H]: Include sys/resource.h as such.
	(stack_grows_down, sigsegv_stack, handle_sigsegv)
	[HAVE_STACK_OVERFLOW_HANDLING]: New variables and function.
	(init_sigsegv): New function.
	(init_signals): Use it.

954 955 956 957 958
2014-08-25  Ken Brown  <kbrown@cornell.edu>

	* emacs.c (main): Remove use of obsolete macro
	G_SLICE_ALWAYS_MALLOC.

959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974
2014-08-25  Eli Zaretskii  <eliz@gnu.org>

	Implement locale-sensitive string collation for MS-Windows.
	* w32proc.c (get_lcid_callback, get_lcid, w32_compare_strings):
	New functions.  (Bug#18051)

	* w32.h (w32_compare_strings): Add prototype.

	* w32.c <g_b_init_compare_string_w>: New global flag.
	(globals_of_w32): Initialize it.

	* sysdep.c (str_collate) [WINDOWSNT]: Implementation for MS-Windows.

	* fns.c (Fstring_collate_lessp, Fstring_collate_equalp)
	[WINDOWSNT]: Call str_collate on MS-Windows.

975 976 977 978 979
2014-08-25  Dmitry Antipov  <dmantipov@yandex.ru>

	One more minor cleanup of font subsystem.
	* font.h (struct font_driver): Convert text_extents to
	return void because returned value is never actually used.
Glenn Morris's avatar
Glenn Morris committed
980
	* macfont.m (macfont_text_extents):
981 982 983 984 985 986
	* w32font.c (w32font_text_extents):
	* xftfont.c (xftfont_text_extents): Adjust to return void
	and assume that 'metrics' argument is always non-NULL.
	* ftfont.c (ftfont_text_extents):
	* xfont.c (xfont_text_extents): Likewise.  Avoid redundant memset.

987 988 989 990 991 992 993 994 995 996 997 998
2014-08-25  Paul Eggert  <eggert@cs.ucla.edu>

	Minor cleanups of str_collate fix (Bug#18051).
	* fns.c (str_collate): Move decl from here ...
	* lisp.h (str_collate): ... to here.
	* sysdep.c (str_collate): Prune away some of the forest of ifdefs.
	Remove unnecessary casts.  Use SAFE_NALLOCA to avoid
	potential problems with integer overflow.  Don't assume
	setlocale succeeds.  Remove unnecessary test before restoring
	locale via setlocale, and free the copied setlocale string
	when done with it.

Michael Albinus's avatar
Michael Albinus committed
999 1000 1001 1002 1003 1004
2014-08-24  Michael Albinus  <michael.albinus@gmx.de>

	* fns.c (Fstring_collate_lessp, Fstring_collate_equalp): New DEFUNs.

	* sysdep.c (str_collate): New function.  (Bug#18051)

1005 1006 1007 1008 1009 1010 1011
2014-08-23  Karol Ostrovsky  <karol.ostrovsky@gmail.com>  (tiny change)

	* Makefile.in (emacs$(EXEEXT)): Retry deletion of bootstrap-emacs
	if the initial "rm -f" fails.  This is for MinGW builds, where
	MS-Windows will not allow deleting the executable file of a
	running program.

1012 1013 1014 1015 1016 1017 1018 1019 1020 1021
2014-08-20  Eli Zaretskii  <eliz@gnu.org>

	* w32term.c (w32_scroll_bar_handle_click)
	(w32_horizontal_scroll_bar_handle_click)
	(x_scroll_bar_report_motion)
	(x_horizontal_scroll_bar_report_motion): For SB_THUMBPOSITION and
	SB_THUMBTRACK, use the 32-bit position information returned by
	GetScrollInfo, not the 16-bit information returned in the Windows
	message sent to us.

1022 1023 1024 1025 1026 1027
2014-08-19  Eli Zaretskii  <eliz@gnu.org>

	* w32term.c (w32_horizontal_scroll_bar_handle_click): Fix the
	second coordinate ('y') reported for dragging the horizontal
	scroll bar thumb.

1028 1029 1030 1031 1032
2014-08-19  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* xdisp.c (erase_phys_cursor): Fix confusion between window-relative
	and text area-relative x-coordinates.

1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044
2014-08-17  Eli Zaretskii  <eliz@gnu.org>

	Avoid overwriting the reversed_p flags in the glyph matrices when
	init_iterator or start_display are called.
	* xdisp.c (init_iterator): Don't initialize the reversed_p flag of
	the glyph row here.
	(tool_bar_height, redisplay_tool_bar, try_window)
	(try_window_reusing_current_matrix, try_window_id)
	(get_overlay_arrow_glyph_row, display_menu_bar): Initialize the
	reversed_p flag of the iterator's glyph row where the glyph row
	is going to be redrawn.

1045 1046 1047 1048
2014-08-16  Paul Eggert  <eggert@cs.ucla.edu>

	* xdisp.c (set_horizontal_scroll_bar): Don't use uninitialized local.

1049 1050 1051 1052 1053 1054 1055
2014-08-16  Martin Rudalics  <rudalics@gmx.at>

	* w32term.c (w32_horizontal_scroll_bar_handle_click): In y part
	of emacs_event return length from si.nPage to si.nMax.
	* xdisp.c (set_horizontal_scroll_bar): For right-to-left text
	interchange start and end of thumb.

1056
2014-08-15  Ken Brown  <kbrown@cornell.edu>
1057 1058 1059 1060

	* gmalloc.c (_malloc_mutex, _aligned_blocks_mutex) [CYGWIN]: Use
	ERRORCHECK mutexes.  (Bug#18222)

1061 1062 1063 1064 1065 1066
2014-08-12  Martin Rudalics  <rudalics@gmx.at>

	* frame.c (set_menu_bar_lines_1): Remove.
	(set_menu_bar_lines): Call change_frame_size instead of
	set_menu_bar_lines_1.

1067 1068 1069 1070 1071
2014-08-11  Jan Djärv  <jan.h.d@swipnet.se>

	* nsfns.m (Fx_create_frame): Call adjust_frame_size,
	set f->official.

1072 1073 1074 1075 1076 1077 1078 1079 1080
2014-08-11  Glenn Morris  <rgm@gnu.org>

	* fileio.c: Revert 2013-01-31 change, which chose coding system for
	writing before backing up, since it causes a more serious problem
	than the one it solves.  (Closes Bug#18141, reopens Bug#13522.)
	(choose_write_coding_system): No longer callable from Lisp.
	Move last piece back here from Fwrite_region.
	(Fwrite_region, syms_of_fileio): Update for above changes.

1081
2014-08-11  Martin Rudalics  <rudalics@gmx.at>
1082 1083 1084 1085 1086 1087

	* window.c (Fwindow_valid_p): Fix doc-string (Bug#18194).
	(Fwindow_new_total, Fwindow_normal_size, Fwindow_new_normal)
	(Fwindow_new_pixel, Fset_window_new_pixel)
	(Fset_window_new_total, Fset_window_new_normal)
	(Fwindow_resize_apply): Fix doc-strings (see Bug#18112).
1088 1089
	See also:
	http://lists.gnu.org/archive/html/bug-gnu-emacs/2014-08/msg00287.html
1090

1091
2014-08-11  Eli Zaretskii  <eliz@gnu.org>
1092 1093 1094 1095

	* fontset.c (Finternal_char_font): Recompute basic faces if the
	frame's face cache was cleared.  (Bug#18162)

1096
2014-08-11  Dmitry Antipov  <dmantipov@yandex.ru>
1097 1098 1099 1100 1101

	Fix bug with uninitialized undo list of an indirect buffer (Bug#18180).
	* buffer.c (Fmake_indirect_buffer): Initialize undo list with the
	base buffer's undo list.

1102 1103 1104 1105 1106 1107
2014-08-10  Reuben Thomas  <rrt@sc3d.org>

	Fix a couple of recent inadvertent breaks of the MSDOS port.
	* msdos.c: include required menu.h
	* term.c: set correct menu_show_hook on MSDOS.

1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130
2014-08-10  Martin Rudalics  <rudalics@gmx.at>

	Fix handling of menu bar line on TTY frames (Bug#18136)
	(Bug#18196).
	* dispnew.c (handle_window_change_signal):
	* keyboard.c (Fsuspend_emacs): Call change_frame_size with
	frame's menu bar lines subtracted from height.
	* frame.c (frame_inhibit_resize): Inhibit resizing of TTY
	frames.
	(adjust_frame_size): Count in menu bar when setting FrameRows.
	(make_terminal_frame): When setting up the frame's lines and
	text height don't count in the menu bar.
	(Fmake_terminal_frame): Call adjust_frame_size with menu bar
	lines subtracted from height.
	(do_switch_frame): Set tty's FrameRows to number of total lines
	of frame.
	(Fframe_pixel_height, Fframe_pixel_width): If no window system
	is used, return total number of lines and columns.
	* menu.c (emulate_dialog_with_menu): Use FRAME_TOTAL_LINES instead
	of FRAME_LINES.
	* term.c (OUTPUT, tty_set_terminal_modes)
	(tty_set_terminal_window, tty_set_scroll_region)
	(tty_clear_to_end, tty_write_glyphs, tty_write_glyphs_with_face)
Stefan Monnier's avatar
Stefan Monnier committed
1131 1132
	(tty_ins_del_lines, tty_menu_display, tty_menu_activate):
	Use FRAME_TOTAL_LINES instead of FRAME_LINES.
1133 1134 1135 1136 1137 1138 1139
	(Fresume_tty): Use FRAME_TOTAL_LINES instead of FRAME_LINES.
	Call change_frame_size with frame's menu bar lines subtracted
	from height.
	* w32console.c (w32con_clear_to_end, w32con_clear_frame)
	(w32con_ins_del_lines): Use FRAME_TOTAL_LINES instead of
	FRAME_LINES.

1140 1141
2014-08-09  Reuben Thomas  <rrt@sc3d.org>

1142
	* alloc.c (Fmemory_info): Remove a stray brace.
Glenn Morris's avatar
Glenn Morris committed
1143

1144
	* process.c: Fix a comment typo.
Glenn Morris's avatar
Glenn Morris committed
1145 1146

	* msdos.c, dosfns.c (init_dosfns): Remove support for DJGPP < 2.02.
1147

1148 1149 1150 1151 1152 1153 1154 1155
2014-08-09  Jan Djärv  <jan.h.d@swipnet.se>

	* widgetprv.h (EmacsFramePart): Remove font.

	* widget.c (DEFAULT_FACE_FONT, EmacsFrameSetValues, setup_frame_gcs)
	(resources, setup_frame_cursor_bits): Remove unused variables and
	functions, esp. wrt. font (Bug#18227).

1156 1157 1158 1159
2014-08-07  Paul Eggert  <eggert@cs.ucla.edu>

	* xterm.c (x_delete_terminal): Plug file descriptor leak (Bug#17691).

1160 1161 1162 1163 1164 1165 1166 1167
2014-08-07  Reuben Thomas  <rrt@sc3d.org>

	Refer to MS-DOS using the same name everywhere.

	* editfns.c: Fix a couple of ``MS-DOG''s missed in the previous
	commit.
	* xfaces.c: ditto.

1168 1169 1170 1171 1172 1173
2014-08-05  Martin Rudalics  <rudalics@gmx.at>

	* w32term.c (w32_redeem_scroll_bar):
	* xterm.c (XTredeem_scroll_bar): Revert part of last change by
	not redeeming scroll bars that have been turned off.

1174 1175 1176 1177 1178 1179 1180
2014-08-05 Dmitry Antipov  <dmantipov@yandex.ru>

	* keyboard.c (safe_run_hooks): Follow the convenient style to bind
	inhibit-quit to t and pass 2 args to safe_run_hook_funcall.  See
	<http://lists.gnu.org/archive/html/emacs-devel/2014-08/msg00077.html>.
	(safe_run_hook_funcall): Adjust accordingly.

1181 1182
2014-08-04  Martin Rudalics  <rudalics@gmx.at>

Stefan Monnier's avatar
Stefan Monnier committed
1183 1184
	* frame.h (FRAME_HAS_HORIZONTAL_SCROLL_BARS):
	Condition correctly according to toolkit used.
1185 1186 1187 1188
	* frame.c (make_initial_frame, make_terminal_frame)
	(x_set_horizontal_scroll_bars, x_set_scroll_bar_height)
	(Vdefault_frame_horizontal_scroll_bars): Correctly condition
	assignments according to presence of toolkit scrollbars.
Stefan Monnier's avatar
Stefan Monnier committed
1189 1190
	* window.h (WINDOW_HAS_HORIZONTAL_SCROLL_BAR):
	Condition correctly according to toolkit used.
1191 1192 1193 1194 1195 1196 1197 1198
	* window.c (set_window_scroll_bars): Set horizontal scroll bar
	only if toolkit supports it.
	* w32term.c (w32_redeem_scroll_bar): Always redeem scroll bar if
	present.
	* xterm.c (x_scroll_bar_create): Initialize horizontal slot for
	non-toolkit builds.
	(XTredeem_scroll_bar): Always redeem scroll bar if present.

1199 1200 1201 1202 1203 1204 1205
2014-08-04 Dmitry Antipov  <dmantipov@yandex.ru>

	* keyboard.c (safe_run_hook_funcall): Avoid consing around
	Vinhibit_quit and prefer internal_condition_case_n to pass args.
	(safe_run_hooks_error, safe_run_hooks_1): Adjust accordingly.
	(safe_run_hooks): Remove comment which is not relevant any more.

1206 1207
2014-08-03  Paul Eggert  <eggert@cs.ucla.edu>

1208 1209 1210 1211
	Don't let big frames overrun the stack.
	* dispnew.c (mirrored_line_dance, mirror_line_dance, scrolling):
	Use SAFE_NALLOCA, not alloca.

1212 1213 1214 1215 1216
	Fix bug with clang + directory_files_internal + GC (Bug#16986).
	* dired.c (directory_files_internal): Use a volatile variable
	to prevent the compiler from optimizing away all copies of a local.
	I wonder how many other GC-related bugs like this lurk elsewhere?

1217 1218 1219 1220 1221 1222
	Avoid 100% CPU utilization on ssh session exit (Bug#17691).
	* xterm.h (struct x_display_info): New member 'connection'.
	* xterm.c (x_term_init, x_delete_terminal): Set and use it,
	so that x_delete_terminal has a file descriptor to pass to
	delete_keyboard_wait_descriptor.

Paul Eggert's avatar
Paul Eggert committed
1223 1224 1225 1226 1227 1228 1229 1230 1231
	Don't mishandle year-9999 dates (Bug#18176).
	* editfns.c (decode_time_components): Store an invalid timespec
	on overflow, instead of returning false, so that the caller can
	distinguish overflow from other errors.
	(lisp_time_argument, lisp_seconds_argument): If the time is out
	of range, signal a time overflow instead of an invalid time spec.
	* keyboard.c (decode_timer): Treat time overflow like other
	timespec errors.

1232 1233 1234 1235 1236 1237 1238 1239
	Avoid undefined behavior with signed left shift.
	Caught by 'gcc -fsanitize=undefined'.
	* dispextern.h, scroll.c (scrolling_max_lines_saved, scrolling_1):
	* dispnew.c (line_hash_code, scrolling):
	* scroll.c (calculate_scrolling, calculate_direct_scrolling):
	Use 'unsigned', not 'int', for line hashes.
	(scrolling_max_lines_saved): Avoid mystery constants for hash sizes.

1240 1241 1242 1243 1244
2014-08-02  Paul Eggert  <eggert@cs.ucla.edu>

	Make compare-strings more compatible with old behavior (Bug#17903).
	* fns.c (Fcompare_strings): Silently bring too-large ends into range.

1245 1246 1247 1248 1249
2014-08-02  Jan Djärv  <jan.h.d@swipnet.se>

	* gtkutil.c (create_dialog): Force min spacing 10 between buttons.
	Don't add label between left and right buttons (Bug#18129).

1250 1251 1252 1253 1254 1255 1256 1257 1258
2014-08-01  Paul Eggert  <eggert@cs.ucla.edu>

	Make functions static that no longer need to be extern.
	* frame.c, frame.h (set_menu_bar_lines):
	* keyboard.c (Qleftmost, Qrightmost):
	* xfns.c, frame.h, menu.h (x_set_menu_bar_lines, x_set_tool_bar_lines)
	(x_set_internal_border_width):
	Now static.

1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271
2014-08-01  Eli Zaretskii  <eliz@gnu.org>

	Fix display of R2L lines when the last character fits only partially.
	See http://lists.gnu.org/archive/html/emacs-devel/2014-07/msg00476.html
	for the details.
	* xdisp.c (extend_face_to_end_of_line): If the last glyph of an
	R2L row is visible only partially, give the row a negative x
	offset.
	(display_line): Fix the calculation of the glyph whose pixel width
	is used to decide whether the last produced glyph fits on the
	line.  When the last glyph fits only partially, give the row a
	negative x offset.

1272 1273 1274 1275 1276 1277
	Fix hscroll of R2L lines that begin with a TAB or another wide glyph.
	* xdisp.c (append_stretch_glyph): In a R2L glyph row, decrease the
	pixel width of the first glyph that is hscrolled from display.
	(display_line): In R2L glyph rows, don't give a negative offset to
	row->x when the first glyph begins before first_visible_x.

1278 1279 1280 1281 1282 1283 1284 1285 1286
	* xdisp.c (display_line): If called with iterator set up to write
	to a marginal area, delay the call to handle_line_prefix until we
	switch back to the text area.  (Bug#18035)

	* .gdbinit (xwindow): The members total_cols, total_lines,
	left_col, and top_line are C integers (and has been so for the
	last 1.5 years).

2014-08-01  Andreas Schwab  <schwab@suse.de>
Andreas Schwab's avatar
Andreas Schwab committed
1287 1288 1289 1290

	* macros.c (Fstart_kbd_macro): Initialize kbd_macro_ptr and
	kbd_macro_end together with kbd_macro_buffer.  (Bug#18140)

1291 1292 1293 1294 1295 1296
2014-08-01  Dmitry Antipov  <dmantipov@yandex.ru>

	* atimer.c (toplevel) [HAVE_TIMERFD]: Include errno.h.
	(timerfd_callback): Ignore weird events with no data.  Add tight
	assertions and comments.
	(init_atimer) [HAVE_TIMERFD]: Add environment variable to optionally
Dmitry Antipov's avatar
Dmitry Antipov committed
1297
	disable timerfd-based timer.  Use TFD_NONBLOCK for timer descriptor.
1298

1299 1300 1301 1302 1303
2014-08-01  Paul Eggert  <eggert@cs.ucla.edu>

	* frame.c (x_set_frame_parameters): Fix typo in previous patch.
	I had confused && with ||.

1304 1305
2014-07-31  Paul Eggert  <eggert@cs.ucla.edu>

1306 1307 1308 1309 1310 1311 1312 1313 1314 1315
	Simplify timerfd configuration and fix some minor glitches.
	* atimer.c (TIMERFD_CREATE_FLAGS): Remove; we now assume TFD_CLOEXEC.
	(alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
	Fall back on timer_create if timerfd_create fails at runtime.
	(resolution) [HAVE_CLOCK_GETRES]: Remove; we now rely on the
	kernel primitives to do resolution.  All uses removed.
	(timerfd) [!HAVE_TIMERFD]: Define to be -1, for convenience.
	(turn_on_atimers): Clear timer_create-based timers too,
	for consistency.

1316 1317 1318 1319 1320
	* frame.c (x_set_frame_parameters): Don't use uninitialized locals.
	Without this change, the code can access the local variable 'width'
	even when it has not been initialized, and likewise for 'height';
	in either case this leads to undefined behavior.

1321 1322 1323 1324 1325
2014-07-30  Dmitry Antipov  <dmantipov@yandex.ru>

	* xrdb.c (x_load_resources) [USE_MOTIF]: Although not strictly
	necessary, put horizontal scroll bar resources as well.  See
	<http://lists.gnu.org/archive/html/emacs-devel/2014-07/msg00430.html>.
1326
	* xterm.c (x_sync_with_move): Really wait 0.5s, not 0.0005s.
1327

1328 1329 1330 1331 1332
2014-07-29  Dmitry Antipov  <dmantipov@yandex.ru>

	* xrdb.c (x_load_resources) [!USE_MOTIF]: Put horizontal scroll bar
	background value to match the resource of its vertical counterpart.

1333 1334 1335 1336 1337
2014-07-29  Martin Rudalics  <rudalics@gmx.at>

	* frame.c (adjust_frame_size): Use FRAME_WINDOW_P instead of
	FRAME_X_WINDOW when calling x_set_window_size (Bug#18138).

1338 1339 1340 1341 1342 1343 1344
2014-07-28  Martin Rudalics  <rudalics@gmx.at>

	* frame.c (x_set_frame_parameters): Revert part of 2014-07-24
	change that added the top margin height to the requested height
	and revert (undocumented) part of 2014-07-28 change that changed
	the logic of whether a size change occurred.

1345 1346
2014-07-28  Eli Zaretskii  <eliz@gnu.org>

Eli Zaretskii's avatar
Eli Zaretskii committed
1347 1348 1349 1350
	* .gdbinit (xwindow): The members total_cols, total_lines,
	left_col, and top_line are C integers (and has been so for the
	last 1.5 years).

1351 1352 1353
	* .gdbinit (xsubchartable): The members 'depth' and 'min_char' are
	now C integers.

1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373
2014-07-28  Dmitry Antipov  <dmantipov@yandex.ru>

	On GNU/Linux, use timerfd for asynchronous timers.
	* atimer.c (toplevel) [HAVE_TIMERFD]: Include sys/timerfd.h.
	(toplevel): Rename alarm_timer_ok to special_timer_available.
	[HAVE_TIMERFD]: Declare timerfd.
	[HAVE_CLOCK_GETRES]: Declare resolution.
	(start_atimer) [HAVE_CLOCK_GETRES]: Round up timestamp to
	system timer resolution.
	(set_alarm) [HAVE_TIMERFD]: Use timerfd_settime.
	(timerfd_callback) [HAVE_TIMERFD]: New function.
	(atimer_result, debug_timer_callback, Fdebug_timer_check)
	[ENABLE_CHECKING]: New function for the sake of automated tests.
	(init_atimer) [HAVE_TIMERFD]: Setup timerfd.
	[HAVE_CLOCK_GETRES]: Likewise for system timer resolution.
	[ENABLE_CHECKING]: Defsubr test function.
	* atimer.h (timerfd_callback) [HAVE_TIMERFD]: Add prototype.
	* lisp.h (add_timer_wait_descriptor) [HAVE_TIMERFD]: Likewise.
	* process.c (add_timer_wait_descriptor) [HAVE_TIMERFD]: New function.

1374 1375 1376 1377 1378 1379 1380 1381
	Fix --without-x build and pacify --enable-gcc-warnings.
	Problems reported in Bug#18122 and Bug#18124.
	* frame.c (get_frame_param): Define even if !HAVE_WINDOW_SYSTEM.
	(frame_windows_min_size): Now static.
	* frame.h (FRAME_HAS_HORIZONTAL_SCROLL_BARS) [!HAVE_WINDOW_SYSTEM]:
	Define as no-op.
	(adjust_frame_size): Always declare prototype.

1382 1383 1384 1385 1386 1387 1388 1389
	Fix Gnus-related issues reported by David Kastrup <dak@gnu.org> in
	<http://lists.gnu.org/archive/html/emacs-devel/2014-07/msg00370.html>.
	* atimer.c (timerfd_callback): Always read expiration data.
	Add comment.
	(turn_on_atimers) [HAVE_TIMERFD]: Disarm timerfd timer.
	* process.c (add_timer_wait_descriptor): Add timer descriptor
	to input_wait_mask and non_process_wait_mask as well.

1390 1391 1392 1393
2014-07-28  Paul Eggert  <eggert@cs.ucla.edu>

	* frame.c (x_set_frame_parameters): Don't use uninitialized locals.

Jan Djärv's avatar
Jan Djärv committed
1394 1395 1396 1397 1398
2014-07-27  Jan Djärv  <jan.h.d@swipnet.se>

	* nsterm.m (applicationDidFinishLaunching antialiasThresholdDidChange):
	Reinstate code removed by the prevoius commit to this file.

1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445
2014-07-27  Martin Rudalics  <rudalics@gmx.at>

	* buffer.h (struct buffer): New fields scroll_bar_height and
	horizontal_scroll_bar_type.
	* buffer.c (bset_scroll_bar_height)
	(bset_horizontal_scroll_bar_type): New functions.
	(Fbuffer_swap_text): Handle old_pointm field.
	(init_buffer_once): Set defaults for scroll_bar_height and
	horizontal_scroll_bar_type.
	(syms_of_buffer): New variables scroll_bar_height and
	horizontal_scroll_bar_type.
	* dispextern.h (window_part): Rename ON_SCROLL_BAR to
	ON_VERTICAL_SCROLL_BAR.  Add ON_HORIZONTAL_SCROLL_BAR.
	(set_vertical_scroll_bar): Remove prototype.
	(x_change_tool_bar_height): Add prototype.
	* dispnew.c (adjust_frame_glyphs_for_frame_redisplay)
	(window_to_frame_vpos, update_frame_1, scrolling, init_display):
	Use FRAME_TOTAL_COLS and FRAME_TOTAL_LINES instead of FRAME_COLS
	and FRAME_LINES.
	(adjust_frame_glyphs_for_window_redisplay): Rearrange lines.
	(update_window): Start mode_line_row->y after horizontal scroll
	bar.
	(change_frame_size_1): Call adjust_frame_size.
	(init_display): When changing the size of a tty frame do not
	pass height of menu bar.
	(Qframe_windows_min_size): New symbol.
	* frame.h (struct frame): List tool bar fields after menu bar
	fields.  Add official, total_lines, horizontal_scroll_bars,
	config_scroll_bar_height and config_scroll_bar_lines fields.
	(FRAME_HAS_HORIZONTAL_SCROLL_BARS)
	(FRAME_CONFIG_SCROLL_BAR_HEIGHT, FRAME_CONFIG_SCROLL_BAR_LINES)
	(FRAME_SCROLL_BAR_AREA_HEIGHT, FRAME_SCROLL_BAR_COLS)
	(FRAME_SCROLL_BAR_LINES, FRAME_TOTAL_LINES, SET_FRAME_LINES)
	(FRAME_WINDOWS_HEIGHT): New macros.
	(SET_FRAME_HEIGHT, FRAME_TEXT_LINES_TO_PIXEL_HEIGHT)
	(FRAME_PIXEL_Y_TO_LINE, FRAME_PIXEL_HEIGHT_TO_TEXT_LINES)
	(FRAME_TEXT_TO_PIXEL_HEIGHT): Separately count top margin and
	horizontal scroll bar.
	(frame_inhibit_resize, adjust_frame_size)
	(frame_windows_min_size): Add declarations.
	(Qscroll_bar_height, Qhorizontal_scroll_bars)
	(x_set_scroll_bar_default_height, x_set_left_fringe)
	(x_set_right_fringe, x_set_vertical_scroll_bars)
	(x_set_horizontal_scroll_bars, x_set_scroll_bar_width)
	(x_set_scroll_bar_height): Add external declarations.
	* frame.c: (frame_inhibit_resize, frame_windows_min_size)
	(adjust_frame_size): New functions.
Stefan Monnier's avatar
Stefan Monnier committed
1446 1447
	(make_frame): Initial horizontal_scroll_bars field.
	Use SET_FRAME_LINES.  Don't allow horizontal scroll bar in
1448 1449 1450 1451 1452
	minibuffer window.
	(make_initial_frame, make_terminal_frame): No horizontal scroll
	bar in initial and terminal frames.  Use adjust_frame_size.
	(Fframe_total_cols): Fix doc-string.
	(Fframe_total_lines, Fscroll_bar_height): New Lisp functions.
Stefan Monnier's avatar
Stefan Monnier committed
1453 1454
	(Fset_frame_height, Fset_frame_width, Fset_frame_size):
	Rewrite using adjust_frame_size.
1455 1456 1457 1458 1459 1460 1461 1462 1463 1464
	(Qscroll_bar_height, Qhorizontal_scroll_bars)
	(Qframe_windows_min_size): New symbols.
	(x_set_frame_parameters): Remove call of check_frame_size.
	(x_report_frame_params): Return scroll_bar_height value.
	(x_set_left_fringe, x_set_right_fringe): New functions.
	(adjust_frame_height, x_set_internal_border_width)
	(x_set_fringe_width): Remove.
	(x_set_internal_border_width, x_set_vertical_scroll_bars)
	(x_set_scroll_bar_width, x_set_right_divider_width)
	(x_set_bottom_divider_width): Rewrite using adjust_frame_size.
Stefan Monnier's avatar
Stefan Monnier committed
1465 1466
	(x_set_horizontal_scroll_bars, x_set_scroll_bar_height):
	New functions.
1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512
	(x_figure_window_size): Rewrite to make frame display the
	expected number of lines.
	(Vdefault_frame_scroll_bars): Rewrite doc-string.
	(Vdefault_frame_horizontal_scroll_bars)
	(Vframe_initial_frame_tool_bar_height)
	(frame_inhibit_implied_resize): New variables.
	* fringe.c (compute_fringe_widths): Remove.
	* gtkutil.h (YG_SB_MIN, YG_SB_MAX, YG_SB_RANGE): Define.
	(xg_create_horizontal_scroll_bar)
	(xg_update_horizontal_scrollbar_pos)
	(xg_set_toolkit_horizontal_scroll_bar_thumb)
	(xg_get_default_scrollbar_height)
	(xg_clear_under_internal_border): Extern.
	* gtkutil.c (xg_frame_resized): Don't call
	do_pending_window_change.
	(xg_frame_set_char_size): Use adjust_frame_size.
	(style_changed_cb): Call update_theme_scrollbar_height and
	x_set_scroll_bar_default_height.
	(x_wm_set_size_hint): Don't call check_frame_size.
	(update_theme_scrollbar_height)
	(xg_get_default_scrollbar_height)
	(xg_create_horizontal_scroll_bar)
	(xg_update_horizontal_scrollbar_pos)
	(xg_set_toolkit_horizontal_scroll_bar_thumb): New functions.
	(xg_create_scroll_bar): Set horizontal slot of bar.
	(xg_initialize): Call update_theme_scrollbar_height.
	(xg_clear_under_internal_border): No more static.
	* insdel.c (adjust_suspend_auto_hscroll): New function.
	(adjust_markers_for_delete, adjust_markers_for_insert)
	(adjust_markers_for_replace): Call adjust_suspend_auto_hscroll.
	* keyboard.c (readable_events, discard_mouse_events)
	(make_lispy_event): Handle horizontal scroll bar click events.
	(Fsuspend_emacs): When changing the size of a tty frame do not
	pass height of menu bar.
	(Qbefore_handle, Qhorizontal_handle, Qafter_handle, Qleft)
	(Qright, Qleftmost, Qrightmost): New symbols.
	* menu.c (Fx_popup_dialog): Use FRAME_TOTAL_LINES instead of
	FRAME_LINES.
	* minibuf.c (read_minibuf): Initialize suspend_auto_hscroll.
	* nsfns.m (x_set_internal_border_width): New function.
	* nsterm.m (ns_draw_fringe_bitmap, ns_set_vertical_scroll_bar):
	Remove extended fringe code.
	(x_set_window_size, x_new_font): Don't call
	compute_fringe_widths.
	* term.c (Fresume_tty): When changing the size of a tty frame do
	not pass height of menu bar.
Stefan Monnier's avatar
Stefan Monnier committed
1513 1514
	(clear_tty_hooks, set_tty_hooks):
	Clear horizontal_scroll_bar_hook.
1515 1516 1517 1518 1519 1520 1521 1522
	(init_tty): Frame has no horizontal scroll bars.
	* termhooks.h (enum scroll_bar_part): Add scroll_bar_move_ratio,
	scroll_bar_before_handle, scroll_bar_horizontal_handle,
	scroll_bar_after_handle, scroll_bar_left_arrow,
	scroll_bar_right_arrow, scroll_bar_to_leftmost and
	scroll_bar_to_rightmost entries.
	(enum event_kind): Add HORIZONTAL_SCROLL_BAR_CLICK_EVENT
	(struct terminal): Add set_horizontal_scroll_bar_hook.
Stefan Monnier's avatar
Stefan Monnier committed
1523 1524
	* w32console.c (initialize_w32_display):
	Clear horizontal_scroll_bar_hook.
1525 1526 1527 1528
	* w32fns.c (x_set_mouse_color): Use FRAME_W32_DISPLAY instead of
	FRAME_X_DISPLAY.
	(x_clear_under_internal_border, x_set_internal_border_width):
	New functions.
Stefan Monnier's avatar
Stefan Monnier committed
1529 1530
	(x_set_menu_bar_lines): Rewrite using frame_inhibit_resize.
	Set windows_or_buffers_changed when adding the menu bar.
1531 1532 1533 1534 1535 1536
	(x_set_tool_bar_lines): Rewrite using adjust_frame_size.
	(x_change_tool_bar_height, x_set_scroll_bar_default_height)
	(w32_createhscrollbar): New functions.
	(w32_createscrollbar): Rename to w32_createvscrollbar.
	(w32_createwindow): Init WND_HSCROLLBAR_INDEX.
	(w32_name_of_message): Replace WM_EMACS_CREATESCROLLBAR by
Stefan Monnier's avatar
Stefan Monnier committed
1537 1538
	WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR.
	Add WM_EMACS_SHOWCURSOR.
1539
	(w32_wnd_proc): Handle WM_HSCROLL case.  In WM_WINDOWPOSCHANGING
Stefan Monnier's avatar
Stefan Monnier committed
1540 1541
	case do not artificially impose WM size hints.
	Handle WM_EMACS_SHOWCURSOR case.  Replace WM_EMACS_CREATESCROLLBAR case
1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559
	by WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR
	cases.
	(my_create_tip_window): Replace WND_SCROLLBAR_INDEX by
	WND_VSCROLLBAR_INDEX and WND_HSCROLLBAR_INDEX.
	(unwind_create_frame_1): Remove.
	(Fx_create_frame): Make both scrollbars the system standard
	width and height.  Use official field of frame structure to
	inhibit running window-configuration-change-hook.
	(x_create_tip_frame): Call SET_FRAME_LINES and change_frame_size
	pixelwise.  Handle frame's official field.
	(w32_frame_parm_handlers): Remove x_set_fringe_width
	entries. Add x_set_scroll_bar_height,
	x_set_horizontal_scroll_bars, x_set_left_fringe and
	x_set_right_fringe.
	* w32inevt.c (resize_event, maybe_generate_resize_event): Do not
	pass height of menu bar to change_frame_size.
	* w32menu.c (set_frame_menubar): Rewrite using
	frame_inhibit_resize.
Stefan Monnier's avatar
Stefan Monnier committed
1560 1561
	* w32term.h (struct w32_display_info):
	Add horizontal_scroll_bar_cursor and cursor_display_counter.
1562 1563 1564 1565 1566 1567 1568 1569 1570
	(struct scroll_bar): Add horizontal.
	(HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT)
	(HORIZONTAL_SCROLL_BAR_LEFT_RANGE)
	(HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH)
	(HORIZONTAL_SCROLL_BAR_LEFT_BORDER)
	(HORIZONTAL_SCROLL_BAR_RIGHT_BORDER)
	(HORIZONTAL_SCROLL_BAR_TOP_BORDER)
	(HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER)
	(HORIZONTAL_SCROLL_BAR_MIN_HANDLE): New macros.
Stefan Monnier's avatar
Stefan Monnier committed
1571 1572
	(WM_EMACS_CREATEVSCROLLBAR, WM_EMACS_CREATEHSCROLLBAR):
	Define instead of WM_EMACS_CREATESCROLLBAR.
1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590
	(WND_VSCROLLBAR_INDEX, WND_HSCROLLBAR_INDEX): Define instead of
	WND_SCROLLBAR_INDEX.
	* w32term.c (horizontal_scroll_bar_min_handle)
	(horizontal_scroll_bar_left_border)
	(horizontal_scroll_bar_right_border): New integers.
	(x_set_frame_alpha): Replace x_highlight_frame by
	w32_focus_frame.
	(x_window_to_scroll_bar): New argument "type".  Update callers
	accordingly.
	(w32_set_horizontal_scroll_bar_thumb)
	(x_horizontal_scroll_bar_report_motion)
	(w32_set_horizontal_scroll_bar)
	(w32_horizontal_scroll_bar_handle_click)
	(x_horizontal_scroll_bar_report_motion): New functions.
	(w32_mouse_position): Discriminate horizontal and vertical
	scrollbar cases.
	(my_create_scrollbar): Replace with two new functions
	my_create_vscrollbar and my_create_hscrollbar.
Stefan Monnier's avatar
Stefan Monnier committed
1591 1592
	(x_scroll_bar_create): New argument "horizontal".
	Update callers accordingly.