summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* * src/keyboard.c: Move keyboard decoding to read_key_sequence.Stefan Monnier2013-03-106-92/+95
| | | | | | | (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 Daniel Colascione <dancol@dancol.org>Daniel Colascione2013-03-106-43/+114
| | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* * src/lread.c: Minor cleanup.Stefan Monnier2013-03-102-47/+32
| | | | | | (FROM_FILE_P): New macro. (skip_dyn_bytes, unreadchar, read1): Use it. (read_list): Consolidate duplicated code.
* * src/bytecode.c (struct byte_stack): Remove `constants' when unused.Stefan Monnier2013-03-102-9/+17
|
* Use macros from dispextern.h where appropriate.Eli Zaretskii2013-03-105-33/+56
| | | | | | | | | | | | | | | | | 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.
* Fix previous change.Kenichi Handa2013-03-111-1/+3
|
* merge trunkKenichi Handa2013-03-101-1/+1
|\
| * coding.c (to_unicode): Fix a typo in a comment.Eli Zaretskii2013-03-091-1/+1
| |
* | On file insertion, skip decoding if all bytes are ASCII.Kenichi Handa2013-03-104-11/+69
|/
* Separate mouse-1-click-follows-link from mouse-drag-region.Stefan Monnier2013-03-083-13/+22
| | | | | | | | | | | | * 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.
* region-cache.c, scroll.c, search.c: Use bool for booleans.Paul Eggert2013-03-085-46/+60
| | | | | | | | | | | | * 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.
* * search.c (find_newline): Accept start and end byte positionsDmitry Antipov2013-03-087-31/+69
| | | | | | | | | | | | | | | | 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.
* print.c, process.c: Use bool for booleans.Paul Eggert2013-03-075-66/+86
| | | | | | | | | | | | | | | | | * 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.
* * bidi.c (bidi_fetch_char): Swap first and second argumentsDmitry Antipov2013-03-083-12/+18
| | | | | | | | | 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.
* src/.gdbinit (prowlims): Display the enabled_p flag of the row.Eli Zaretskii2013-03-072-1/+5
|
* Avoid character to byte conversions in motion subroutines.Dmitry Antipov2013-03-074-61/+66
| | | | | | | | | | | | | | | | * 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.
* * lisp.h (list2i, list3i): New functions.Dmitry Antipov2013-03-0713-58/+61
| | | | | | | | | | | | | | | (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.
* Rename find_next_newline to find_newline_no_quit.Eli Zaretskii2013-03-066-18/+32
| | | | | | | | | | | | 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.
* Fix bug #13879 with raw-text encoding of msdos.c.Eli Zaretskii2013-03-062-10/+22
| | | | | src/msdos.c: Change encoding to cp850. (Bug#13879) (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
* Coding system support cleanup and minor refactoring.Dmitry Antipov2013-03-063-61/+37
| | | | | | | | | | | | | | | | | | * 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.
* Merge from emacs-24; up to 2012-12-25T11:37:21Z!dmantipov@yandex.ruGlenn Morris2013-03-062-23/+15
|\
| * Fix a build failure on OpenBSD 4.x and MirBSD.Paul Eggert2013-03-052-5/+6
| | | | | | | | | | | | | | * 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
| * Fix a build failure on OpenBSD 4.x and MirBSD.Paul Eggert2013-03-052-18/+9
| | | | | | | | | | | | | | | | | | | | | | | | * 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
* | * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.Dmitry Antipov2013-03-066-14/+19
| | | | | | | | | | | | | | * 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.
* | FILE's lock is now always .#FILE and may be a regular file.Paul Eggert2013-03-054-190/+321
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* | Don't sync charpos and bytepos in bidi_resolve_explicit_1.Eli Zaretskii2013-03-052-5/+16
| | | | | | | | | | | | | | 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>.
* | Remove stray character from license URL.Paul Eggert2013-03-041-1/+1
| |
* | Merge from emacs-24; up to 2012-12-24T15:56:17Z!eliz@gnu.orgGlenn Morris2013-03-042-0/+18
|\ \ | |/
| * Also port to MirBSD.Paul Eggert2013-03-042-5/+7
| |
| * Fix a build failure on OpenBSD 4.x.Paul Eggert2013-03-042-0/+16
| | | | | | | | | | | | | | | | * 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>.
* | * composite.c (get_composition_id, fill_gstring_header):Dmitry Antipov2013-03-054-6/+16
| | | | | | | | | | | | Use make_uninit_vector where appropriate. * font.c (Ffont_get_glyphs, build_style_table): Likewise. * xselect.c (clean_local_selection_data): Likewise.
* | Fix misuse of ImageMagick that caused core dump.Paul Eggert2013-03-042-5/+11
| | | | | | | | | | | | | | * image.c (imagemagick_load_image): Calculate height and width after flattening the image, not before. Fixes: debbugs:13846
* | * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.Dmitry Antipov2013-03-044-3/+10
| | | | | | | | | | * ftfont.c (ftfont_shape_by_flt): Likewise. * w32uniscribe.c (uniscribe_shape): Likewise.
* | * filelock.c (lock_file): Don't access freed storage.Paul Eggert2013-03-022-27/+23
| |
* | The lock for FILE is now .#FILE or .#-FILE.Paul Eggert2013-03-022-51/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old approach, which fell back on DIR/.#FILE.0 through DIR/.#FILE.9, had race conditions that could not be easily fixed. If DIR/.#FILE is a non-symlink file, Emacs now does not create a lock file for DIR/FILE; that is, DIR/FILE is no longer partly protected by a lock if DIR/.#FILE is a non-symlink file ("partly" because the locking mechanism was never reliable in that case). This patch fixes this and other bugs discovered by a code inspection that was prompted by <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>. Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows, to avoid interoperability problems between the MS-Windows and non-MS-Windows implementations. MS-Windows and non-MS-Windows instances of Emacs now ignore each others' locks. * etc/NEWS: Document this. * src/filelock.c (defined_WINDOWSNT): New constant. (MAKE_LOCK_NAME, fill_in_lock_file_name): Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE regular files on MS-Windows hosts. (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p): Use SAFE_ALLOCA to avoid problems with long file names. (MAX_LFINFO): Now a local constant, not a global macro. (IS_LOCK_FILE): Remove. (lock_file_1): Don't inspect errno if symlink call succeeds; that's not portable. (lock_file): Document that this function can return if lock creation fails. Fixes: debbugs:13807
* | Merge from emacs-24; up to 2012-12-23T17:06:58Z!eliz@gnu.orgGlenn Morris2013-03-022-1/+5
|\ \ | |/
| * Fixes: debbugs:13734Andreas Schwab2013-03-022-1/+5
| | | | | | | | * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren.
* | * textprop.c: Use bool for booleans.Paul Eggert2013-03-023-5/+12
| | | | | | | | | | (validate_interval_range, Fadd_text_properties) (Fremove_text_properties): Prefer bool to int when either works.
* | Protect against changes of interval tree when adding/removing text props.Eli Zaretskii2013-03-022-4/+49
| | | | | | | | | | | | | | src/textprop.c (Fadd_text_properties, Fremove_text_properties): If the interval tree changes as a side effect of calling modify_region, re-do processing starting from the call to validate_interval_range. (Bug#13743)
* | Revert last commit; fixed on emacs-24 branch instead.Eli Zaretskii2013-03-022-5/+1
| |
* | Fix bug #13734 with errors in lisp.h macro expansion.Eli Zaretskii2013-03-022-1/+5
| | | | | | | | src/lisp.h (XPNTR) [!USE_LSB_TAG]: Fix parentheses nesting.
* | Merge from emacs-24; up to 2012-12-23T02:41:17Z!rgm@gnu.orgGlenn Morris2013-02-272-2/+5
|\ \ | |/
| * w32.c (sys_open): Don't reset the flags for FD in fd_info[].Eli Zaretskii2013-02-272-2/+5
| | | | | | | | Related to bug #13546.
* | Fix race conditions with MS-Windows lock files by using _sopen.Eli Zaretskii2013-02-272-4/+17
| | | | | | | | | | | | | | | | src/filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with _SH_DENYRW flag, instead of emacs_open, to deny any other process access to the lock file until it is written and closed. Fixes: debbugs:13807
* | Qcall_interactively and Qexecute_kbd_macro are now static.Paul Eggert2013-02-264-4/+9
| |
* | * window.c (Frecenter): Tiny docstring enhancement.Bastien Guerry2013-02-262-1/+5
| |
* | Minor textprop integer cleanup.Paul Eggert2013-02-253-81/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * intervals.h, textprop.c (add_text_properties_from_list): Return void, not int, since nobody uses the return value. * textprop.c (validate_plist, add_properties, remove_properties) (Fadd_text_properties): Don't assume list length fits in int. (interval_has_all_properties, interval_has_some_properties) (interval_has_some_properties_list, add_properties, remove_properties) (Fadd_text_properties, Fremove_text_properties) (Fremove_list_of_text_properties, text_property_stickiness): Use bool for booleans. (Fadd_text_properties, Fremove_text_properties): (Fremove_list_of_text_properties): Reindent do-while as per GNU style.
* | Implement CLASH_DETECTION for MS-Windows.Eli Zaretskii2013-02-255-21/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/filelock.c [WINDOWSNT]: Include w32.h. (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime function of that name. Up-case the macro arguments. (IS_LOCK_FILE): New macro. (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK. (create_lock_file): New function, with body extracted from lock_file_1. [WINDOWSNT]: Implement lock files by writing a regular file with the lock information as its contents. (read_lock_data): New function, on Posix platforms just calls emacs_readlinkat. [WINDOWSNT]: Read the lock info from the file. (current_lock_owner): Call read_lock_data instead of calling emacs_readlinkat directly. (lock_file) [WINDOWSNT]: Run the file name through dostounix_filename. src/w32proc.c (sys_kill): Support the case of SIG = 0, in which case just check if the process by that PID exists. src/w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is also present, as doing so will fail to error out if the file already exists. src/makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h. nt/inc/ms-w32.h (BOOT_TIME_FILE): Define. nt/config.nt (CLASH_DETECTION): Define to 1. lisp/emacs-lisp/bytecomp.el (byte-recompile-directory): Reject files that match "\`\.#", to avoid compiling lock files, even if they are readable (as they are on MS-Windows). doc/emacs/files.texi (Interlocking): Don't refer to symlinks as the exclusive means of locking files. etc/NEWS: Mention support for lock files on MS-Windows.
* | Fix bug #13743 with crashes due to recursive add-text-properties.Eli Zaretskii2013-02-252-59/+75
| | | | | | | | | | | | | | | | | | src/textprop.c (Fadd_text_properties, Fremove_text_properties) (Fremove_list_of_text_properties): Skip all of the intervals in the region between START and END that already have resp. don't have the requested properties, not just the first one. Add assertions that the loop afterwards always modifies the properties.
* | * src/callint.c (Fcall_interactively): Use the right lexical environmentStefan Monnier2013-02-253-3/+9
| | | | | | | | | | | | | | for `interactive' specs. * src/eval.c (Feval): Accept a lexical environment. Fixes: debbugs:13811