1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-27 07:41:28 -08:00
Commit graph

34591 commits

Author SHA1 Message Date
Eli Zaretskii
102ae68de4 Update commentary in w32notify.c. 2013-07-02 19:32:03 +03:00
Eli Zaretskii
bcffb5caf8 Fix bug #2749 with overflow-newline-into-fringe in visual-line-mode.
src/xdisp.c (IT_OVERFLOW_NEWLINE_INTO_FRINGE): Don't disallow
 word-wrap, so that overflow-newline-into-fringe would work in
 visual-line-mode.
 (move_it_in_display_line_to): When the last scanned display
 element fits exactly on the display line, and
 overflow-newline-into-fringe is non-nil, but wrap_it is valid,
 don't return MOVE_NEWLINE_OR_CR, but instead back up to the last
 wrap point and return MOVE_LINE_CONTINUED.  Fixes problems with
 finding buffer position that corresponds to pixel coordinates,
 e.g. in buffer_posn_from_coords.
2013-07-02 18:52:07 +03:00
Jan Djärv
2c41e78194 * process.c (handle_child_signal): Call catch_child_signal if NS_IMPL_GNUSTEP. 2013-07-02 14:46:43 +02:00
Paul Eggert
52a9bcae40 Don't convert function pointers to void * and back.
It isn't portable C, and it's easy enough to avoid.
* alloc.c: Verify SAVE_FUNCPOINTER bits, too.
(make_save_value): Add support for SAVE_FUNCPOINTER.
* keymap.c (map_keymap_char_table_item, map_keymap_internal):
* print.c (print_object):
Distinguish function from object pointers.
* lisp.h (SAVE_FUNCPOINTER): New constant.
(SAVE_SLOT_BITS): Adjust to it.
(SAVE_TYPE_FUNCPTR_PTR_OBJ): New constant, replacing
SAVE_TYPE_PTR_PTR_OBJ.  Change the only use.
(voidfuncptr): New typedef.
(struct Lisp_Save_Value): New member data[0].funcpointer.
(XSAVE_FUNCPOINTER): New function.
2013-07-01 20:41:16 -07:00
Paul Eggert
c2418359b3 Simplify buildobj processing.
* Makefile.in (buildobj.h): Make it a sequence of strings each
followed by comma, rather than a single string.  Put it into a
.tmp file in case there's an error while generating it.
(gl-stamp): Use .tmp for temp files.
(mostlyclean): Clean .tmp files.
* doc.c (buildobj): Move to just the routine that needs it.
It's now an array of strings, so processing is simpler.
2013-07-01 17:57:46 -07:00
Paul Eggert
ab71f1741c Remove duplicate ChangeLog entry, again. 2013-07-01 14:44:44 -07:00
Paul Eggert
8f43ce497c Fix bug re noninteractive multithreaded memory allocation.
* emacs.c (malloc_enable_thread): Hoist extern decl to top level.
(main) [HAVE_PTHREAD && !SYSTEM_MALLOC && !DOUG_LEA_MALLOC]:
Invoke malloc_enable_thread even when not interactive.
Problem reported by Ken Brown in <http://bugs.gnu.org/14569#275>.
* process.c (init_process_emacs) [CYGWIN]: Tickle glib even
in this case, since the underlying bug has now been fixed.
2013-07-01 14:06:12 -07:00
Juanma Barranquero
24827db9c4 src/emacs.c (Fkill_emacs): Expand Vauto_save_list_file_name before unlinking it.
Fixes: debbugs:14691
2013-07-01 18:54:37 +02:00
Michal Nazarewicz
ef099a941f Add `remember-notes' function to store random notes across Emacs
restarts.
* remember.el (remember-data-file): Add :set callback to affect
notes buffer (if any).
(remember-notes): New command.
(remember-notes-buffer-name, bury-remember-notes-on-kill):
New defcustoms for the `remember-notes' function.
(remember-notes-save-and-bury-buffer): New command.
(remember-notes-mode-map): New variable.
(remember-mode): New minor mode.
(remember-notes--kill-buffer-query): New function.
* lisp/startup.el (initial-buffer-choice): Add notes to custom type.
* src/buffer.c (FKill_buffer): Run `kill-buffer-query-functions'
before checking whether buffer is modified.  This lets
`kill-buffer-query-functions' cancel killing of the buffer or save
its content before `kill-buffer' asks user the "Buffer %s
modified; kill anyway?" question.

* remember.el (remember-append-to-file):
Don't mix `find-buffer-visiting' and `get-file-buffer'.

* lisp/files.el (find-file-noselect): Simplify conditional expression.
2013-06-30 18:29:23 -04:00
Jan Djärv
9d3f2fc286 * nsfns.m (handlePanelKeys): Don't process Command+Function keys.
Let the super performKeyEquivalent deal with them.

Fixes: debbugs:14747
2013-06-30 18:38:26 +02:00
Paul Eggert
1d71c1d9de Fix minor problems found by static checking.
* lwlib/lwlib-Xaw.h (xaw_update_one_value, xaw_popup_menu):
* lwlib/lwlib-Xlw.h (xlw_update_one_value, xlw_pop_instance):
* lwlib/lwlib.h (lw_allow_resizing, lw_set_main_areas) [!USE_MOTIF]:
Now const.
* src/widget.c (resize_cb): Remove unused local.
2013-06-30 09:14:22 -07:00
Paul Eggert
16b6e7f29b Remove duplicate ChangeLog entry. 2013-06-30 08:33:01 -07:00
Paul Eggert
8f5f35ccca Do not use GTK 3 if it exists but cannot be compiled.
* configure.ac: Leave GTK_OBJ and term_header alone if GTK 3
exists but cannot be compiled.
* src/xmenu.c (x_menu_wait_for_event) [!USE_GTK]:
* src/xterm.c (x_error_handler) [!USE_GTK]:
Do not use GTK 3.
2013-06-30 08:24:14 -07:00
Paul Eggert
e6c6c8c774 * intervals.c (get_local_map): Actually clip POSITION
Fixes: debbugs:14753
2013-06-30 08:14:45 -07:00
Paul Eggert
adc5dbceb0 Spelling fixes. 2013-06-30 08:10:33 -07:00
Eli Zaretskii
5d1c328614 A possible fix for bug #14753 with aborts in get_local_map.
src/intervals.c (get_local_map): Instead of aborting, clip POSITION
 to the valid range of values.
2013-06-30 18:03:31 +03:00
Eli Zaretskii
0ba54312c9 Don't call sit-for in right-char and left-char for visual cursor motion.
src/xdisp.c (Fmove_point_visually): Invalidate the cursor position
 when moving point by using the current glyph matrix.  This avoids
 the need to force redisplay when this function is called in a
 loop.

 lisp/bindings.el (right-char, left-char): Don't call sit-for, this is
 no longer needed.  Use arithmetic comparison only for numerical
 arguments.
2013-06-30 17:49:33 +03:00
Juanma Barranquero
c1ea3abfde Fix typos in ChangeLogs. 2013-06-29 22:19:29 +02:00
Eli Zaretskii
671796d3e0 Fix typo in src/ChangeLog. 2013-06-29 23:10:30 +03:00
Paul Eggert
9c90cc06dd Fix minor problems found by static checking.
* coding.c (encode_inhibit_flag, inhibit_flag): New functions.
Redo the latter's body to sidestep GCC parenthesization warnings.
(setup_coding_system, detect_coding, detect_coding_system): Use them.
* coding.c (detect_coding, detect_coding_system):
* coding.h (struct undecided_spec):
Use bool for boolean.
* image.c (QCmax_width, QCmax_height): Now static.
* xdisp.c (Fmove_point_visually): Remove unused local.
2013-06-29 08:52:20 -07:00
Eli Zaretskii
4c672a0fec Implement visual-order cursor motion.
src/xdisp.c (Fmove_point_visually): New function.

 lisp/bindings.el (visual-order-cursor-movement): New defcustom.
 (right-char, left-char): Provide visual-order cursor motion by
 calling move-point-visually.  Update the doc strings.

 doc/emacs/basic.texi (Moving Point): Document visual-order-cursor-movement
 and its effect on right-char and left-char.

 doc/lispref/display.texi (Bidirectional Display): Document move-point-visually.

 etc/NEWS: Document the new feature.
2013-06-29 16:36:19 +03:00
Kenichi Handa
73b1b3ad61 merge trunk 2013-06-29 12:44:38 +09:00
Kenichi Handa
2ed909207e merge trunk 2013-06-29 12:31:15 +09:00
YAMAMOTO Mitsuharu
df03dc8a4c * image.c (image_unget_x_image): Fix formatting. 2013-06-29 08:36:14 +09:00
Kenichi Handa
c3a7b3f45f coding.c (setup_coding_system): Handle CODING->spec.undecided.
(detect_coding): Likewise.
(detect_coding_system): Likewise.
(Fdefine_coding_system_internal): New coding system properties
:inhibit-null-byte-detection, :inhibit-iso-escape-detection, and
:prefer-utf-8.
(syms_of_coding): Adjusted for coding_arg_undecided_max.
2013-06-29 00:00:17 +09:00
Kenichi Handa
270afa77ee coding.h (define_coding_undecided_arg_index): New enum.
(coding_attr_index): New members
coding_attr_undecided_inhibit_null_byte_detection,
coding_attr_undecided_inhibit_iso_escape_detection,
coding_attr_undecided_prefer_utf_8.
(undecided_spec): New struct.
(struct coding_system): New member `undecied' of the member
`spec'.
2013-06-28 23:59:50 +09:00
Paul Eggert
ba3de9e6ab * image.c (x_from_xcolors): Remove unused local. 2013-06-27 22:48:53 -07:00
YAMAMOTO Mitsuharu
b8075603a4 Fix W32-specific part of last change. 2013-06-28 12:41:37 +09:00
YAMAMOTO Mitsuharu
04b66ce7c6 Fix typo in ChangeLog for last commit. 2013-06-28 11:44:19 +09:00
YAMAMOTO Mitsuharu
547c92696e Defer image data transfer between X client and server until actual display happens. 2013-06-28 11:37:23 +09:00
Paul Eggert
dae2f5ef41 Do not tickle glib SIGCHLD handling if Cygwin.
This mostly consists of undoing recent changes.
* callproc.c (Fcall_process):
* process.c (create_process):
Do not worry about catching SIGCHLD here, undoing previous change.
* nsterm.m (ns_term_init): Re-catch SIGCHLD, undoing previous change.
* process.c, process.h (catch_child_signal):
No longer extern if !NS_IMPL_GNUSTEP, undoing 06-22 change.
* process.c (catch_child_handler): Don't worry about being called
lazily and do not assume caller has blocked SIGCHLD, undoing
previous change.  Move first-time stuff back to
init_process_emacs, undoing 06-22 change.  If CYGWIN, do not
tickle glib, as that causes Cygwin bootstrap to fail.  Do not
set lib_child_handler if it's already initialized, which may
help avoid problems on GNUStep.
2013-06-27 07:47:52 -07:00
Paul Eggert
fa55d2aaa2 A more-conservative workaround for Cygwin SIGCHLD issues.
* callproc.c (Fcall_process):
* process.c (create_process):
Make sure SIGCHLD is caught before we fork,
since Emacs startup no arranges to catch SIGCHLD.
* process.c (lib_child_handler): Initialize to null, not to
dummy_handler.
(catch_child_signal): Allow self to be called lazily.
Do nothing if it's already been called.
Assume caller has blocked SIGCHLD (all callers do now).
* emacs.c (main): Do not catch SIGCHLD here; defer it until
just before it's really needed.
* nsterm.m (ns_term_init): No need to re-catch SIGCHLD here,
since it hasn't been caught yet.

Fixes: debbugs:14569
2013-06-23 17:31:31 -07:00
Lars Magne Ingebrigtsen
f3f9606c7a Implement :max-width/:max-height for (ImageMagic) images
* doc/lispref/display.texi (ImageMagick Images): Mention :max-width and
:max-height.

* lisp/net/shr.el (shr-rescale-image): Use the new
:max-width/:max-height functionality.

* src/image.c (compute_image_size): New function to implement
:max-width and :max-height.
(imagemagick_load_image): Use it.
2013-06-23 21:24:27 +02:00
Paul Eggert
c7041908b8 Try to avoid malloc SEGVs on Cygwin.
* callproc.c, process.h (block_child_signal, unblock_child_signal):
Now extern.
* emacs.c (main): Catch SIGCHLD just before initializing gfilenotify.
* process.c (catch_child_signal): Block SIGCHLD while futzing with
the SIGCHLD handler, since the code is not atomic and (due to glib)
signals may be arriving now.
* sysdep.c (init_signals): Do not catch child signals here;
'main' now does that later, at a safer time.

Fixes: debbugs:14569
2013-06-23 11:18:47 -07:00
Paul Eggert
0dfeed58d3 Clean up SIGCHLD handling a bit.
* process.c, process.h (catch_child_signal):
Now always extern, even if !NS_IMPL_GNUSTEP.
* process.c (catch_child_signal): Move glib tickler here from
init_process_emacs, so that it's done earlier in Emacs
initialization.  Also move the noninteractive && !initialized
check here from init_process_emacs.  This is all a bit cleaner for
GNUish platforms, and I hope it works around the Cygwin bug.
* sysdep.c (init_signals): Invoke catch_child_signal here, so
that glib signal handling is tickled before glib creates threads.

Fixes: debbugs:14569
2013-06-22 12:01:47 -07:00
Paul Eggert
f86852b4a3 * process.c (wait_reading_process_output): Avoid int overflow
when reading more than 2 GiB total from a process.
2013-06-22 09:43:39 -07:00
Paul Eggert
cbd6509c29 * process.c (create_process): Handle a couple more cases,
i.e., work even if new_argv and wait_child_setup[i] are cached.
Use Fcall_process's style for volatile vars.
2013-06-21 15:16:37 -07:00
Andreas Schwab
9de1114ad8 * process.c (create_process): Mark PROCESS volatile. 2013-06-21 23:27:17 +02:00
Paul Eggert
fbe9e0b9fb Use C99-style flexible array members if available.
This avoids some subtle aliasing issues, which typically
aren't a problem with GCC but may be a problem elsewhere.
* lib-src/ebrowse.c (struct member, struct alias, struct sym):
Use FLEXIBLE_ARRAY_MEMBER.
(add_sym, add_member, make_namespace, register_namespace_alias):
Use offsetof (struct, flex_array_member), not sizeof (struct), as
that ports better to pre-C99 non-GCC.
* src/alloc.c (sdata): New typedef, replacing the old struct sdata.
It is a struct if GC_CHECK_STRING_BYTES, a union otherwise.
In either case, it uses a flexible array member rather than
the old struct hack.  All uses changed.
(SDATA_NBYTES, sweep_strings) [!GC_CHECK_STRING_BYTES]:
Adjust to sdata reorganization.
* src/alloc.c (VBLOCK_BYTES_MIN, allocate_vectorlike, Fgarbage_collect):
Use offsetof (struct, flex_array_member), not sizeof (struct), as
that ports better to pre-C99 non-GCC.
* src/chartab.c (Fmake_char_table, make_sub_char_table, copy_char_table):
Use CHAR_TABLE_STANDARD_SLOTS rather than its definition,
as the latter has changed.
* src/conf_post.h (FLEXIBLE_ARRAY_MEMBER): Move here from w32.c,
and port better to pre-C99 GCC.
* src/image.c (struct xpm_cached_color):
* src/lisp.h (struct Lisp_Vector, struct Lisp_Bool_Vector)
(struct Lisp_Char_Table, struct Lisp_Sub_Char_Table):
Use FLEXIBLE_ARRAY_MEMBER.
* src/lisp.h (string_bytes) [GC_CHECK_STRING_BYTES]:
Move decl to top level so it gets checked against implementation.
(CHAR_TABLE_STANDARD_SLOTS): Adjust to struct Lisp_Char_Table change.
* src/w32.c (FLEXIBLE_ARRAY_MEMBER): Move to conf_post.h.
2013-06-21 13:11:44 -07:00
Paul Eggert
1fc7100890 * syntax.c: Integer cleanups.
(SYNTAX_FLAGS_COMMENT_STYLEC): Return a boolean, not 0-or-2.
All uses that need 0-or-2 changed to:
(SYNTAX_FLAGS_COMMENT_STYLEC2): New macro, with the same semantics
as the old SYNTAX_FLAGS_COMMENT_STYLEC.
(struct lisp_parse_state, syntax_prefix_flag_p, update_syntax_table)
(char_quoted, prev_char_comend_first, back_comment)
(Finternal_describe_syntax_value, skip_chars, skip_syntaxes)
(in_classes, forw_comment, scan_lists, scan_sexps_forward):
Use bool for boolean.
(update_syntax_table, skip_chars, skip_syntaxes):
Prefer int to unsigned when either will do.
(back_comment): Return boolean success flag, like forw_comment,
instead of positive-or-minus-1 (which might have overflowed int anyway).
Don't stuff ptrdiff_t into int.
(syntax_spec_code, syntax_code_spec): Now const.
(Fmatching_paren, scan_lists, scan_sexps_forward):
Use enum syntaxcode for syntax code.
(Fmatching_paren): Check that arg is a character, not just an integer.
(Fstring_to_syntax): Don't assume 0377 fits in enum syntaxcode.
(Finternal_describe_syntax_value): Omit no-longer-needed
comparison to 0.
(skip_chars): Use char, not unsigned char, when the distinction
doesn't matter.
(forw_comment, scan_lists): Prefer A |= B to A = A || B when B's cheap.
* bytecode.c (exec_byte_code):
* syntax.c (syntax_spec_code, Fchar_syntax)
(Finternal_describe_syntax_value, skip_chars, skip_syntaxes)
(init_syntax_once):
* syntax.h (SYNTAX_WITH_FLAGS):
Omit unnecessary casts.
2013-06-20 11:59:08 -07:00
Eli Zaretskii
b932cad712 Yet another attempt at fixing bugs #14602, 14630, 14669.
src/w32fns.c (w32_wnd_proc): Don't compute the header line and mode
 line dimensions here, to avoid race conditions with the main
 thread.
 src/w32term.c (w32_draw_window_cursor): Compute the header line and
 mode line dimensions here.
 <w32_system_caret_window, w32_system_caret_hdr_height>:
 <w32_system_caret_mode_height>: New variables.
 src/w32term.h: Declare them.
2013-06-20 20:36:24 +03:00
Paul Eggert
5013fc0876 * alloc.c (die): Move "assertion failed" string here ...
* lisp.h (eassert): ... from here.  Also, suppress evaluation of
COND when SUPPRESS_CHECKING.  This shrinks the executable text
size by 0.8% to 2.2% when configured with --enable-checking,
depending on optimization flags (GCC 4.8.1 x86-64).
2013-06-20 07:47:46 -07:00
Paul Eggert
89561f72e5 Add log2 support and make log10 obsolete for consistency.
* configure.ac (log2): Check for this function.
* doc/lispref/numbers.texi (Math Functions): Remove obsolete function log10.
* lisp/subr.el (log10): Move here from C code, and declare as obsolete.
All uses of (log10 X) replaced with (log X 10).
* src/floatfns.c (Flog) [HAVE_LOG2]: Use log2 if available and if the
base is 2; this is more accurate.
(Flog10): Move to Lisp (marked obsolete there).
2013-06-20 07:15:42 -07:00
Paul Eggert
33cbd259d6 * floatfns.c: Add commentary re C99 and C11. 2013-06-19 18:19:43 -07:00
Juanma Barranquero
4f40506961 Fix typos in ChangeLogs. 2013-06-19 22:10:57 +02:00
Juanma Barranquero
983aeb9aff src/sound.c: Silence some warnings.
(string_default): Move to !WINDOWSNT section.
(Fplay_sound_internal) [WINDOWSNT]: Remove i_result to avoid warning.
2013-06-19 16:20:26 +02:00
Paul Eggert
bbc51b1565 * sound.c: Integer cleanups.
Remove unnecessary forward decls.
(struct sound_device): The 'file' member is now a Lisp_Object, not
a char *, so that we needn't invoke alloca on a huge size.
(Fplay_sound_internal): Adjust to this.
(string_default): New function.
(vox_open, vox_init, alsa_open, alsa_configure, alsa_init):
Use it to adjust to the struct sound_device change.
(parse_sound, wav_init, au_init, alsa_init): Use bool for booleans.
(be2hs) [0]: Remove.
2013-06-19 00:36:20 -07:00
Paul Eggert
178ba3e6f5 * syntax.c (skip_chars): Don't use uninitialized storage
when searching a multibyte buffer for characters that are not in a
unibyte string that contains non-ASCII characters.
2013-06-18 22:45:35 -07:00
Jan Djärv
69f60cdc23 * process.c: Include xgselect.h if HAVE_GLIB. Include glib.h
if HAVE_GLIB && ! WINDOWSNT.

Fixes: debbugs:14654
2013-06-18 20:41:48 +02:00
Paul Eggert
0d6224d432 * conf_post.h: Add comments for INLINE, EXTERN_INLINE, etc. 2013-06-18 11:36:13 -07:00