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

34325 commits

Author SHA1 Message Date
Paul Eggert
cded56c19b * coding.c (decode_coding_gap): Fix typo caught by static checking. 2013-03-15 13:03:31 -07:00
Kenichi Handa
646859d33a merge trunk 2013-03-16 01:04:47 +09:00
Kenichi Handa
8a44e6d176 Optimize ASCII file reading with EOL format detection and decoding. 2013-03-16 01:03:54 +09:00
Eli Zaretskii
5f795e34b3 Match the effect of FULLSCREEN_BOTH and FULLSCREEN_MAXIMIZED to docs on Windows.
src/w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
 FULLSCREEN_MAXIMIZED.

Fixes: debbugs:13935
2013-03-15 12:07:29 +02:00
Eli Zaretskii
4e2df81da5 src/ChangeLog: Fix a typo in a recent entry. 2013-03-15 09:32:28 +02:00
Dmitry Antipov
f258b4be00 * region-cache.c (find_cache_boundary, move_cache_gap)
(insert_cache_boundary, delete_cache_boundaries, set_cache_region):
Simplify debugging check and convert to eassert.  Adjust comment.
(pp_cache): Put under ENABLE_CHECKING.
2013-03-15 11:23:49 +04:00
Eli Zaretskii
a5cc4ddeb8 Fix bug #13953 with spontaneous frame resizes on MS-Windows.
src/w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
 and incorrect code.  Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
 and WM_ACTIVATEAPP.
 (w32fullscreen_hook): If the frame is visible, reset
 f->want_fullscreen flag after changing the frame size.  If the
 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
2013-03-14 19:37:51 +02:00
Daniel Colascione
3fc5e44aaa * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
too so that these builds can use Cygwin's file conversion
functions.  (We've been building and linking cygw32.o all along
and just not using it.)
2013-03-13 11:28:50 -08:00
Paul Eggert
47d7532e09 File synchronization fixes.
* admin/CPP-DEFINES (BSD_SYSTEM, HAVE_FSYNC): Remove.
* admin/merge-gnulib (GNULIB_MODULES): Add fsync, fdatasync.
* configure.ac (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
(fsync): Remove check; now done by gnulib.
* lib/fdatasync.c, lib/fsync.c, m4/fdatasync.m4, m4/fsync.m4:
New files, from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* lib-src/Makefile.in (LIB_FDATASYNC): New macro.
(emacsclient${EXEEXT}): Use it.
* lib-src/emacsclient.c (main): Use fdatasync, not fsync, since we don't
care about metadata.  Keep trying if interrupted.
* lib-src/movemail.c (main, popmail): Don't worry about BSD_SYSTEM, since
fsync is available everywhere (or there is a substitute).  Don't
report an error if fsync returns EINVAL.
* nt/inc/ms-w32.h (fdatasync): New macro, suggested by Eli Zaretskii.
* src/Makefile.in (LIB_FDATASYNC): New macro.
(LIBES): Use it.
* src/conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
* src/fileio.c (Fwrite_region, write_region_inhibit_fsync):
Don't worry about HAVE_FSYNC, since a substitute fsync is
available if the system lacks one.
(Fwrite_regin): Retry fsync if interrupted.

Fixes: debbugs:13944
2013-03-13 11:42:22 -07:00
Eli Zaretskii
c7ffccaf17 Fix bug #13937 with creating a maximized frame on MS-Windows.
src/w32term.c (w32_read_socket): If we Emacs frame is being
 activated, call w32fullscreen_hook, to make sure the new frame
 dimensions are in effect.
2013-03-13 19:31:06 +02:00
Dmitry Antipov
ffcd945ec5 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
character and byte positions can be obtained from marker.
2013-03-13 19:41:54 +04:00
Dmitry Antipov
8a7debc14c * xdisp.c (init_iterator): Simplify because both character and byte
positions are either specified or -1.  Add eassert.  Adjust comment.
2013-03-13 19:21:46 +04:00
Paul Eggert
d9df6f40e3 Static checking by Sun C 5.12.
* lib-src/etags.c (analyse_regex): Omit unreachable code.
* src/alloc.c (buffer_memory_full) [REL_ALLOC]:
* src/bytecode.c (exec_byte_code):
* src/dispnew.c (init_display):
* src/eval.c (error):
* src/fileio.c (Fsubstitute_in_file_name):
* src/keyboard.c (Fevent_convert_list):
* src/keymap.c (Fsingle_key_description):
* src/term.c (maybe_fatal, fatal):
* src/xfns.c (Fx_display_backing_store, Fx_display_visual_class):
* src/xsmfns.c (Fhandle_save_session):
Omit unreachable code.
* src/keymap.c (map_keymap_char_table_item): Cast void * to
a function pointer type; the C Standard requires this.
2013-03-13 00:27:34 -07:00
Paul Eggert
7fd8c501a0 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
Include <sys/param.h> unconditionally, as that works elsewhere and
is simpler here.  Include <sys/sysctl.h> if DARWIN_OS ||
__FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
and FreeBSD now.
2013-03-12 22:04:46 -07:00
Paul Eggert
307d0e95ee Spelling fixes. 2013-03-10 21:07:45 -07:00
Paul Eggert
cb0290dfa2 * insdel.c (adjust_after_replace): Use bool for boolean. 2013-03-10 21:02:06 -07:00
Stefan Monnier
cbae07d5e0 * src/keyboard.c: Move keyboard decoding to read_key_sequence.
(decode_keyboard_code): Remove.
(tty_read_avail_input): Don't try to decode input.
(read_decoded_char): New function.
(read_key_sequence): Use it.
2013-03-10 21:17:40 -04:00
Daniel Colascione
819e2da92a 2013-03-10 Daniel Colascione <dancol@dancol.org>
* w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
	(GUI_SDATA, guichar_t): Macros to abstract out differences between
	NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
	w32fns.c.

	* w32term.c (construct_drag_n_drop): Use the above macros to make
	drag-and-drop work for non-ASCII filenames in cygw32 builds.

	* w32fns.c (x_set_name, x_set_title): Use the above macros to
	properly display non-ASCII frame titles in cygw32 builds.

	* w32fns.c (Fw32_shell_execute): Use the above macros to properly
	call ShellExecute in cygw32 builds.

	* w32fn.c (Fx_file_dialog): Use the above macros to simplify the
	common file dialog code.

	* w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
	can just use du like other systems.

	* coding.c (from_unicode_buffer): Declare.
	* coding.c (from_unicode_buffer): Implement.
2013-03-10 14:55:25 -08:00
Stefan Monnier
d2e24f924a * src/lread.c: Minor cleanup.
(FROM_FILE_P): New macro.
(skip_dyn_bytes, unreadchar, read1): Use it.
(read_list): Consolidate duplicated code.
2013-03-10 17:52:01 -04:00
Stefan Monnier
99ec16475a * src/bytecode.c (struct byte_stack): Remove `constants' when unused. 2013-03-10 17:46:55 -04:00
Eli Zaretskii
138c0ae83d Use macros from dispextern.h where appropriate.
src/xdisp.c (display_tool_bar_line, redisplay_tool_bar)
 (redisplay_internal, set_cursor_from_row, try_window)
 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
 (display_line, notice_overwritten_cursor)
 (mouse_face_from_buffer_pos, note_mouse_highlight): Use
 MATRIX_ROW_DISPLAYS_TEXT_P.
 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
 (mouse_face_from_string_pos, fast_find_string_pos): Use
 MATRIX_ROW_VPOS.
 src/xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
 src/w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
 src/xdisp.c (try_cursor_movement): Use MATRIX_ROW and
 MATRIX_MODE_LINE_ROW.
 src/dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
2013-03-10 19:28:04 +02:00
Kenichi Handa
7d051e2154 Fix previous change. 2013-03-11 00:06:04 +09:00
Kenichi Handa
a6ebf83d90 merge trunk 2013-03-10 23:43:58 +09:00
Kenichi Handa
c230dd7d89 On file insertion, skip decoding if all bytes are ASCII. 2013-03-10 23:36:35 +09:00
Eli Zaretskii
bc989a58e2 coding.c (to_unicode): Fix a typo in a comment. 2013-03-09 20:09:33 +02:00
Stefan Monnier
27a98a62d1 Separate mouse-1-click-follows-link from mouse-drag-region.
* lisp/mouse.el (mouse--down-1-maybe-follows-link): New function.
(key-translation-map): Use it to implement mouse-1-click-follows-link.
(mouse-drag-line, mouse-drag-track): Remove mouse-1-click-follows-link code.
(mouse--remap-link-click-p): Remove.
* src/keyboard.c (access_keymap_keyremap): Accept nil return value from
functions to mean "no change".
* src/keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
(POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
from Elisp via unread-command-events.
2013-03-08 23:15:53 -05:00
Paul Eggert
457882c20c region-cache.c, scroll.c, search.c: Use bool for booleans.
* lisp.h (compile_pattern):
* scroll.c (do_scrolling, do_direct_scrolling):
* search.c (struct regexp_cache, compile_pattern_1)
(compile_pattern, string_match_1, search_command)
(trivial_regexp_p, search_buffer, Freplace_match, match_limit)
(search_regs_saved, Fregexp_quote):
Use bool for boolean.
* region-cache.c (region_cache_forward, region_cache_backward):
Fix comments to match code: these functions return int, not boolean.
2013-03-08 13:37:41 -08:00
Dmitry Antipov
b542656108 * search.c (find_newline): Accept start and end byte positions
as arguments and allow -1 if not known.
(find_newline_no_quit): Likewise for start position.
* lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
* bidi.c (bidi_find_paragraph_start): Pass byte position to
find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
* editfns.c (Fconstrain_to_field): Break long line.  Adjust
call to find_newline.
* indent.c (vmotion): Adjust calls to find_newline_no_quit.
Use DEC_BOTH to start next search from the previous buffer
position, where appropriate.
* xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
(get_visually_first_element, move_it_vertically_backward): Likewise.
Obtain byte position from the display iterator, where appropriate.
2013-03-08 13:34:35 +04:00
Paul Eggert
0bce5d9eb8 print.c, process.c: Use bool for booleans.
* lisp.h (wait_reading_process_output):
* print.c (print_output_debug_flag, PRINTDECLARE, printchar)
(strout, debug_output_compilation_hack, float_to_string, print)
(print_object):
* process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
(decode_status, status_message, create_process, create_pty)
(Fmake_network_process, Fnetwork_interface_info)
(wait_reading_process_output, read_process_output)
(write_queue_push, write_queue_pop, process_send_signal)
(handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
* process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
Use bool for booleans.
* process.c (Fnetwork_interface_list): Remove unused local.
(connect_counter): Now EMACS_INT, not int.
2013-03-07 18:32:21 -08:00
Dmitry Antipov
36075a19b2 * bidi.c (bidi_fetch_char): Swap first and second arguments
to match other functions accepting character and byte positions.
Adjust comment.
(bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
(bidi_paragraph_init): Likewise.  Use DEC_BOTH which is faster
when you need just to move to the previous buffer position.
* xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
2013-03-08 03:37:36 +04:00
Eli Zaretskii
4aae191435 src/.gdbinit (prowlims): Display the enabled_p flag of the row. 2013-03-07 13:31:07 +02:00
Dmitry Antipov
c54aa1668e Avoid character to byte conversions in motion subroutines.
* indent.h (compute_motion, vmotion): Add byte position argument.
* indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
Add eassert.
(Fcompute_motion): Break long line.  Adjust call to compute_motion.
Use list5 for return value.
(vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
Adjust comments, style and calls to compute_motion.
(Fvertical_motion): Adjust call to vmotion.
* window.c (Fdelete_other_windows_internal): Record window start
byte position and adjust call to vmotion.
(window_scroll_line_based): Likewise with call to compute_motion.
Use SET_PT_BOTH.
(Frecenter): Adjust calls to vmotion.
2013-03-07 08:42:59 +04:00
Dmitry Antipov
3de717bdb4 * lisp.h (list2i, list3i): New functions.
(list4i): Move from window.c and make LISP_INLINE.
* editfns.c (make_lisp_time):
* fns.c (Flocale_info):
* keyboard.c (parse_modifiers):
* xterm.c (x_ewmh_activate_frame): Use list2i.
* instel.c (signal_after_change):
* nsfns.m (Fx_server_version, Fxw_color_values):
* w32fns.c (Fxw_color_values, Fx_server_version):
* xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
* fileio.c (Fvisited_file_modtime):
* nsfns.m (Fns_display_usable_bounds):
* w32.c (ltime): Use list4i.
2013-03-07 07:01:17 +04:00
Eli Zaretskii
a611149e46 Rename find_next_newline to find_newline_no_quit.
src/search.c (find_newline_no_quit): Rename from find_next_newline.
 Add commentary.
 src/lisp.h (find_newline_no_quit): Rename prototype.
 src/xdisp.c (back_to_previous_line_start)
 (forward_to_next_line_start, get_visually_first_element)
 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
 src/indent.c (vmotion): Callers of find_newline_no_quit changed.
 src/bidi.c (bidi_find_paragraph_start): Callers of
 find_newline_no_quit changed.
2013-03-06 18:35:23 +02:00
Eli Zaretskii
d26e478eaa Fix bug #13879 with raw-text encoding of msdos.c.
src/msdos.c: Change encoding to cp850.  (Bug#13879)
 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
2013-03-06 18:21:26 +02:00
Dmitry Antipov
1af1a51aad Coding system support cleanup and minor refactoring.
* coding.h (enum coding_result_code): Remove
CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
(toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
(CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
(CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
(CODING_MODE_SAFE_ENCODING): Rearrange bit values.
(decode_coding_region, encode_coding_region, decode_coding_string):
Remove unused compatibility macros.
* coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
(record_conversion_result): Adjust user.
(syms_of_coding): Likewise.
(ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
(decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
(decode_coding_object): Simplify since xrealloc never returns NULL.
Add eassert.
2013-03-06 15:26:30 +04:00
Glenn Morris
0bafabe7b2 Merge from emacs-24; up to 2012-12-25T11:37:21Z!dmantipov@yandex.ru 2013-03-06 00:01:47 -08:00
Paul Eggert
0845a75c6a Fix a build failure on OpenBSD 4.x and MirBSD.
* sysdep.c (list_system_processes): Make it a stub on all BSD_SYSTEM
hosts, except for DARWIN_OS and FreeBSD where it's been tested.

Fixes: debbugs:13881
2013-03-05 23:46:09 -08:00
Dmitry Antipov
ffc65beee9 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
* xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
(get_visually_first_element, move_it_vertically_backward): Ajust users.
* bidi.c (bidi_find_paragraph_start): Likewise.
* indent.c (vmotion): Likewise.
2013-03-06 03:08:11 +04:00
Paul Eggert
707431575a FILE's lock is now always .#FILE and may be a regular file.
* etc/NEWS: Document this.
* nt/inc/unistd.h (O_NOFOLLOW): New macro.
* src/filelock.c: Include <c-ctype.h>.
(MAX_LFINFO): New top-level constant.
(lock_info_type): Remove members pid, boot_time.  Add members at,
dot, colon.  Change user member to be the entire buffer, not a
pointer.  This allows us to handle the case where a foreign
pid or boot time exceeds the local range.  All uses changed.
(LINKS_MIGHT_NOT_WORK): New constant.
(FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
(defined_WINDOWSNT): Remove.
(MAKE_LOCK_NAME, file_in_lock_file_name):
Always use .#FILE (not .#-FILE) for the file lock,
even if it is a regular file.
(rename_lock_file): New function.
(create_lock_file): Use it.
(create_lock_file, read_lock_data):
Prefer a symbolic link for the lock file, falling back on a
regular file if symlinks don't work.  Do not try to create
symlinks on MS-Windows, due to security hassles.  Stick with
POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
link, rename, unlink, mkstemp) when creating locks, as a GNUish
host may be using a Windowsish file system, and cannot use
MS-Windows-only system calls.  Fall back on mktemp if mkstemp
doesn't work.  Don't fail merely because of a symlink-contents
length limit in the current file system; fall back on regular
files.  Increase the symlink contents length limit to 8 KiB, this
should be big enough for any real use and doesn't crunch the
stack.
(create_lock_file, lock_file_1, read_lock_data):
Simplify allocation of lock file buffers now that they fit in 8 KiB.
(lock_file_1): Return error number, not bool.  All callers changed.
(ELOOP): New macro, if not already defined.
(read_lock_data): Return size of lock file contents, not Lisp object.
All callers changed.  Handle a race condition if some other process
replaces a regular-file lock with a symlink lock or vice versa,
while we're trying to read the lock.
(current_lock_owner): Parse contents more carefully, to help avoid
confusing a regular-file lock with some other application's use
of the file.  Check for lock file contents being too long, or
not parsing correctly.
(current_lock_owner, lock_file):
Allow foreign pid and boot times that exceed the local range.
(current_lock_owner, lock_if_free, lock_file):
Simplify allocation of lock file contents.
* src/w32.c (sys_rename_replace): New function, containing most of
the contents of the old sys_rename.
(sys_rename): Use it.
(fchmod): New dummy function.
* src/w32.h (sys_rename_replace, fchmod): New decls.

Fixes: debbugs:13807
2013-03-05 14:35:41 -08:00
Paul Eggert
9b1c327138 Fix a build failure on OpenBSD 4.x and MirBSD.
* sysdep.c (list_system_processes) [__OpenBSD__ || __MirBSD__]:
Make it a stub in this case; otherwise the build might fail,
and even if the build worked the function would just return nil anyway.
Problem reported by Nelson H. F. Beebe in
<http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
and analyzed by Jérémie Courrèges-Anglas in
<http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.

Fixes: debbugs:13881
2013-03-05 13:56:36 -08:00
Eli Zaretskii
05e193f170 Don't sync charpos and bytepos in bidi_resolve_explicit_1.
src/bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
 to be in sync with bidi_it->bytepos.  Suggested by Dmitry Antipov
 <dmantipov@yandex.ru>.
2013-03-05 20:12:25 +02:00
Paul Eggert
a2332e8da9 Remove stray character from license URL. 2013-03-04 23:10:55 -08:00
Glenn Morris
28b6b84d4e Merge from emacs-24; up to 2012-12-24T15:56:17Z!eliz@gnu.org 2013-03-04 19:59:35 -08:00
Paul Eggert
a318f81169 Also port to MirBSD. 2013-03-04 18:15:35 -08:00
Paul Eggert
725eb02724 Fix a build failure on OpenBSD 4.x.
* sysdep.c (KERN_PROC, kinfo_proc) [BSD_SYSTEM && !KERN_PROC]:
Define to KERN_PROC2 and kinfo_proc2, for OpenBSD 4.9.
list-system-processes still returns nil, but at least it doesn't crash.
Problem reported by Nelson H. F. Beebe in
<http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>.
2013-03-04 18:03:05 -08:00
Dmitry Antipov
3bfc46eb53 * composite.c (get_composition_id, fill_gstring_header):
Use make_uninit_vector where appropriate.
* font.c (Ffont_get_glyphs, build_style_table): Likewise.
* xselect.c (clean_local_selection_data): Likewise.
2013-03-05 05:48:30 +04:00
Paul Eggert
84ac6f9d21 Fix misuse of ImageMagick that caused core dump.
* image.c (imagemagick_load_image): Calculate height and width
after flattening the image, not before.

Fixes: debbugs:13846
2013-03-04 09:35:29 -08:00
Dmitry Antipov
42926ec878 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
* ftfont.c (ftfont_shape_by_flt): Likewise.
* w32uniscribe.c (uniscribe_shape): Likewise.
2013-03-04 11:41:01 +04:00
Paul Eggert
2db4137542 * filelock.c (lock_file): Don't access freed storage. 2013-03-02 13:05:52 -08:00