aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Narrow DARWIN_OS_CASE_SENSITIVE_FIXME to 1 choicePaul Eggert2017-05-201-46/+22
| | | | | | | | | * etc/PROBLEMS: Document this (Bug#24441). * src/fileio.c (file_name_case_insensitive_p): Prefer pathconf with _PC_CASE_SENSITIVE, if it works, to DARWIN_OS_CASE_SENSITIVE_FIXME code. Support just one method for DARWIN_OS_CASE_SENSITIVE_FIXME, which matches the Apple documentation more precisely.
* Fix macOS mouse movementCharles A. Roelli2017-05-213-8/+47
| | | | | | | | | | | | | | * lisp/frame.el (ns-set-mouse-absolute-pixel-position): New function (Lisp). (set-mouse-absolute-pixel-position): Change it to call `ns-set-mouse-absolute-pixel-position' on macOS. * src/nsfns.m (Fns_set_mouse_absolute_pixel_position): New function. * src/nsterm.h (NS_PARENT_WINDOW_TOP_POS): Use the primary screen's height as a base for calculating global coordinates. * src/nsterm.m (frame_set_mouse_pixel_position): Fix it in macOS. * test/lisp/mouse-tests.el (bug26816-mouse-frame-movement): Test movement of mouse relative to frame.
* Show tooltip on correct screen (bug#26905)Alan Third2017-05-211-7/+20
| | | | | * src/nsfns.m (compute_tip_xy): Find the correct screen for the tooltip and constrain it to that screen.
* Minor fixes for arity ranges in emacs modulesPaul Eggert2017-05-201-11/+11
| | | | | | | * src/emacs-module.c (module_make_function): Check that arities fit into fixnums, for func-arity’s benefit. (funcall_module): Avoid unnecessary conversion to EMACS_INT. (module_function_arity): Allow arities greater than SHRT_MAX.
* Reimplement module functionsPhilipp Stephani2017-05-207-85/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of a lambda, create a new type containing all data required to call the function, and support it in the evaluator. Because this type now also needs to store the function documentation, it is too big for Lisp_Misc; use a pseudovector instead. That also has the nice benefit that we don't have to add special support to the garbage collector. Since the new type is user-visible, give it a predicate. Now we can easily support 'help-function-args' and 'func-arity'; add unit tests for these. * src/lisp.h (allocate_module_function, MODULE_FUNCTIONP) (XMODULE_FUNCTION): New pseudovector type 'module function'. * src/eval.c (FUNCTIONP): Also treat module functions as functions. (funcall_lambda, Ffuncall, eval_sub): Add support for calling module functions. (Ffunc_arity): Add support for detecting the arity of module functions. * src/emacs-module.c (module_make_function): Adapt to new structure. Return module function object directly instead of wrapping it in a lambda; remove FIXME. (funcall_module): New function to call module functions. Replaces `internal--module-call' and is called directly from eval.c. (syms_of_module): Remove internal helper function, which is no longer needed. (module_function_arity): New helper function. * src/data.c (Ftype_of): Adapt to new implementation. (Fmodule_function_p, syms_of_data): New user-visible function. Now that module functions are first-class objects, they deserve a predicate. Define it even if not compiled with --enable-modules so that Lisp code doesn't have to check for the function's existence. * src/doc.c (Fdocumentation): Support module functions. * src/print.c (print_object): Adapt to new implementation. * src/alloc.c (mark_object): Specialized garbage collector support is no longer needed. * lisp/help.el (help-function-arglist): Support module functions. While there, simplify the arity calculation by using `func-arity', which does the right thing for all kinds of functions. * test/data/emacs-module/mod-test.c: Amend docstring so we can test the argument list. * test/src/emacs-module-tests.el (mod-test-sum-docstring): Adapt to new docstring. (mod-test-non-local-exit-signal-test): Because `internal--module-call' is gone, the backtrace has changed and no longer leaks the implementation. (module--func-arity): New test for `func-arity'. (module--help-function-arglist): New test for `help-function-arglist'.
* Avoid crashes in GC due to unescaped characters warningEli Zaretskii2017-05-201-4/+4
| | | | | * src/lread.c (load_warn_unescaped_character_literals): Don't cons Lisp objects from stack-based variables. (Bug#26961)
* Fix automatic hscrolling of only the current lineEli Zaretskii2017-05-201-31/+39
| | | | | | | | | * src/xdisp.c (display_line): When hscrolling only the current line, increment iterator's first_visible_x and last_visible_x values to account for the hscroll. This propagates the hscroll effect on the iterator geometry all the way down to the subroutines called by display_line, and avoids scrolling bugs under large hscroll values. (Bug#26994)
* Add handlerlist assertion to module codePaul Eggert2017-05-191-2/+4
| | | | | | * src/emacs-module.c (module_reset_handlerlist): Check handlerlist. Suggested by Philipp Stephani in: http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00521.html
* Check that signed right shift is arithmeticPaul Eggert2017-05-191-5/+8
| | | | | | | | * src/data.c (ash_lsh_impl): Verify that signed right shift is arithmetic; if we run across a compiler that uses a logical shift we’ll need to complicate the code before removing this compile-time check. Help the compiler do common subexpression elimination better.
* Attempt to work around macOS vfork bugPaul Eggert2017-05-193-16/+24
| | | | | | | | | | | | Problem reported by YAMAMOTO Mitsuharu in: http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00342.html This is related to the fix for Bug#26397. * src/callproc.c (call_process_cleanup, call_process) [!MSDOS]: Report internal error if wait_for_termination fails. * src/sysdep.c (get_child_status): Return -1 if waitpid is buggy, instead of aborting. (wait_for_termination): Return bool success value. All callers changed.
* Fix DARWIN_OS_CASE_SENSITIVE_FIXME==2 false alarmPaul Eggert2017-05-181-2/+7
| | | | | | | | * src/fileio.c (file_name_case_insensitive_p): Don’t compile the (DARWIN_OS_CASE_SENSITIVE_FIXME == 2) code unless DARWIN_OS_CASE_SENSITIVE_FIXME is 2. Problem reported by Philipp Stephani in: http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00495.html
* Clean up compiler warning in emacs-module.cPaul Eggert2017-05-181-6/+7
| | | | | | | * src/emacs-module.c (MODULE_SETJMP_1): Use the local var instead of leaving it unused, to pacify picky compilers. (module_reset_handlerlist): Now takes a dummy pointer to a struct handler *, instead of a dummy pointer to an int. All uses changed.
* Clean up some compiler warningsPhilipp Stephani2017-05-181-5/+0
| | | | | * src/sysdep.c (system_process_attributes) [DARWIN_OS]: Remove unused locals.
* Support hscrolling only the current lineEli Zaretskii2017-05-181-42/+91
| | | | | | | | | | | | | | | | | | | | | | | * src/xdisp.c (hscrolling_current_line_p): New function. (init_iterator): If auto-hscrolling just the current line, don't increment the iterator's first_visible_x and last_visible_x variables. (hscroll_window_tree): Recompute window's hscroll when moving vertically to another screen line. (redisplay_window): If we are hscrolling only the current line, disable the optimizations that rely on the current matrix being up-to-date. (display_line): Accept an additional argument CURSOR_VPOS, the vertical position of the current screen line which might need hscrolling; all callers changed. Compute first_visible_x and last_visible_x specially when auto-hscrolling current line, by repeating the calculation that is done in init_iterator in other modes. (syms_of_xdisp) <auto-hscroll-mode>: No longer boolean, it can now accept a 3rd value 'current-line, to turn on the mode where only the current line is hscrolled. * etc/NEWS: Mention the new auto-hscroll-mode value.
* Avoid undefined behavior in struct sockaddrPaul Eggert2017-05-172-14/+31
| | | | | | | | | | Problem noted by Philipp Stephani in: http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00391.html * src/conf_post.h (ATTRIBUTE_MAY_ALIAS, DECLARE_POINTER_ALIAS): New macros. * src/process.c (conv_sockaddr_to_lisp, conv_lisp_to_sockaddr) (connect_network_socket, network_interface_info) (server_accept_connection): Use it when aliasing non-char objects.
* Work around AddressSanitizer bug with vforkPaul Eggert2017-05-171-0/+6
| | | | | | | | | | Problem reported by Jim Meyering in: http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00246.html * src/conf_post.h (vfork) [ADDRESS_SANITIZER]: Define to fork. Unfortunately with the AddressSanitizer in Fedora 25 x86-64, the vforked child messes up the parent’s shadow memory. This is too bad, as we’d rather have AddressSanitizer catch memory-access bugs related to vfork.
* Catch IPv4/IPv6 issues at compile timePaul Eggert2017-05-171-5/+5
| | | | | | * src/process.c (connect_network_socket): Use verify, not eassert, so that any problems are caught at compile-time. Avoid dodgy cast by using a local var of the correct type.
* Pacify --enable-gcc-warnings --with-x-toolkit=noPaul Eggert2017-05-171-1/+1
| | | | | * src/composite.c (autocmp_chars) [!HAVE_WINDOW_SYSTEM]: Avoid unused local.
* Remove redundant code in connect_network_socketEli Zaretskii2017-05-171-22/+19
| | | | | | | | * src/process.c (connect_network_socket) [HAVE_GETSOCKNAME]: Remove redundant type-casting and variables. Don't call 'getsockname' to find the port for AF_LOCAL sockets. [AF_INET6]: Add an assertion to verify that the ports in the IPv4 and IPv6 structures are at the same offset and have the same size.
* Fix minor timezone memory leakPaul Eggert2017-05-161-4/+1
| | | | * src/editfns.c (wall_clock_tz): Remove; unused.
* Do not discard AddressSanitizer stderrPaul Eggert2017-05-161-2/+5
| | | | | * src/emacs.c (close_output_streams) [ADDRESS_SANITIZER]: Do not close stderr.
* Simplify procname code to avoid GCC bugPaul Eggert2017-05-161-29/+24
| | | | | | | | | * src/process.c (server_accept_connection): Simplify and avoid multiple calls and struct literals in the last case of a switch. The old code ran afoul of GCC bug 80659, which caused an internal compiler error. Problem reported by Jim Meyering in: http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00182.html https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80659
* Pacify GCC 7 with --enable-gcc-warningsPaul Eggert2017-05-161-1/+1
| | | | | * src/regex.c (regex_compile): Swap labels, so that the FALLTHROUGH immediately precedes the case label.
* Merge with gnulib, pacifying GCC 7Paul Eggert2017-05-1618-44/+59
| | | | | | | | | | | | | | | | | | | | | | | | This incorporates: 2017-05-16 manywarnings: update for GCC 7 2017-05-15 sys_select: Avoid "was expanded before it was required" * configure.ac (nw): Suppress GCC 7’s new -Wduplicated-branches and -Wformat-overflow=2 options, due to too many false alarms. * doc/misc/texinfo.tex, lib/strftime.c, m4/manywarnings.m4: Copy from gnulib. * m4/gnulib-comp.m4: Regenerate. * src/coding.c (decode_coding_iso_2022): Fix bug uncovered by -Wimplicit-fallthrough. * src/conf_post.h (FALLTHROUGH): New macro. Use it to mark all switch cases that fall through. * src/editfns.c (styled_format): Use !, not ~, on bool. * src/gtkutil.c (xg_check_special_colors): When using sprintf, don’t trust Gtk to output colors in [0, 1] range. (xg_update_scrollbar_pos): Avoid use of possibly-uninitialized bool; this bug was actually caught by Clang. * src/search.c (boyer_moore): Tell GCC that CHAR_BASE, if nonzero, must be a non-ASCII character. * src/xterm.c (x_draw_glyphless_glyph_string_foreground): Tell GCC that glyph->u.glyphless.ch must be a character.
* Fix address violation found by AddressSanitizerPaul Eggert2017-05-141-6/+22
| | | | | | | | | * src/process.c (connect_network_socket): Use struct sockaddr_storage, not struct sockaddr_in, to store info about a socket address. Problem reported by Philipp Stephani in: http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00314.html This fix is based on a patch by Philipp in: http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00357.html
* Remove gettimeofday from w32 sourcesEli Zaretskii2017-05-141-27/+0
| | | | | | * lib-src/ntlib.c (gettimeofday): * nt/inc/sys/time.h (gettimeofday, struct timezone): Remove unused function 'gettimeofday' and all of its supporting code.
* Fix the MS-Windows buildEli Zaretskii2017-05-141-2/+4
| | | | | * nt/inc/sys/time.h (gettimeofday): * src/w32.c (gettimeofday): Adjust signature to match Gnulib.
* Make `old-style-backquotes' variable internalPhilipp2017-05-131-8/+9
| | | | | | | | | | | | | * src/lread.c (load_warn_old_style_backquotes, Fload, read1) (syms_of_lread): Rename `old-style-backquotes' to `lread--old-style-backquotes', and clarify that it's for internal use only. * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Rename variable. * test/src/lread-tests.el (lread-tests--old-style-backquotes): Add unit test. * emacs-lisp/bytecomp-tests.el (bytecomp-tests--old-style-backquotes): Add unit test.
* Improve unescaped character literal warningsPhilipp Stephani2017-05-131-1/+5
| | | | | | | | | | | * src/lread.c (load_warn_unescaped_character_literals) (syms_of_lread): lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Improve formatting of unescaped character literal warnings. * test/src/lread-tests.el (lread-tests--unescaped-char-literals): test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--unescaped-char-literals): Adapt unit tests.
* Implement 1-based column numbering in mode linePerry E. Metzger2017-05-102-6/+11
| | | | | | | | | | | | | | | | | | | | | * src/xdisp.c (decode_mode_spec): Implement the %C construct. * lisp/bindings.el (column-number-indicator-zero-based): New defcustom. (mode-line-position): Use %C when column-number-indicator-zero-based is nil. * src/xdisp.c (syms_of_xdisp) <frame-title-format>: * src/buffer.c (syms_of_buffer) <mode-line-format>: * doc/lispref/modes.texi (%-Constructs): * doc/lispref/frames.texi (Frame Titles): Document the %C construct. * doc/emacs/display.texi (Optional Mode Line): Document 'column-number-indicator-zero-based'. * etc/NEWS: Mention 'column-number-indicator-zero-based' and the %C construct.
* Ensure cursor's foreground color is in sync with 'default' faceEli Zaretskii2017-05-101-0/+4
| | | | | | * src/w32term.c (x_set_cursor_gc): Don't reuse cursor GC if its foreground color is different from the background of the glyph string's face. (Bug#26851)
* More informative error when required feature missingGlenn Morris2017-05-091-2/+11
| | | | | * src/fns.c (Frequire): Include file name in missing feature error. * doc/lispref/loading.texi (Named Features): Don't quote actual error.
* Put re-loaded file back at start of load-history (bug#26837)Glenn Morris2017-05-091-1/+2
| | | | | | | | | * src/lread.c (readevalloop): Fix the "whole buffer" check to operate in the correct buffer. (Feval_buffer): Move point back to the start after checking for lexical binding. * test/src/lread-tests.el (lread-test-bug26837): New test. * test/data/somelib.el, test/data/somelib2.el: New test data files.
* Revert "Output number of characters added to file (Bug#354)"Noam Postavsky2017-05-081-28/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The extra message text turned out to be quite annoying in practice, and is generally more trouble than it's worth. Also revert several related changes. Partially revert "Handle `write-region' messages in Tramp properly" Revert "New var write-region-verbose, default nil" Revert "* src/fileio.c (write_region): Don't say "1 characters". (Bug#26796)" Revert "Minor tuneup of write-region change" Revert "Adjust write-region so file name is at the beginning again" Revert "Fix handling of non-integer START param to write-region" Revert "Output number of characters added to file (Bug#354)" * doc/emacs/files.texi (Misc File Ops): * etc/NEWS: * lisp/epa-file.el (epa-file-write-region): * lisp/gnus/mm-util.el (mm-append-to-file): * lisp/jka-compr.el (jka-compr-write-region): * lisp/net/ange-ftp.el (ange-ftp-write-region): * lisp/net/tramp-adb.el (tramp-adb-handle-write-region): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-write-region): * lisp/net/tramp-sh.el (tramp-sh-handle-write-region): * lisp/net/tramp-smb.el (tramp-smb-handle-write-region): * lisp/net/tramp.el (tramp-handle-write-region-message): * src/fileio.c (write_region, syms_of_fileio): * test/lisp/net/tramp-tests.el (tramp-test10-write-region): Remove extra characters from file writing messages.
* Fix glyph string generation for multi-font compositions (Bug#26742)YAMAMOTO Mitsuharu2017-05-081-3/+25
| | | | | | | * src/xdisp.c (glyph_string_containing_background_width): New function. (draw_glyphs): Use it to get correct background width. (compute_overhangs_and_x): Don't change x in the middle of composite characters.
* New var write-region-verbose, default nilPaul Eggert2017-05-061-11/+23
| | | | | | | | By popular demand, write-region char counts are now off by default (Bug#26796). * src/fileio.c (write-region-verbose): New Lisp var. (write_region): Output char count only if the var is non-nil. * doc/emacs/files.texi (Misc File Ops), etc/NEWS: Document this.
* Port .gdbinit to GDB 7.11.1 + Python 2.7.12Paul Eggert2017-05-062-2/+2
| | | | | | | | | * src/.gdbinit (Lisp_Object_Printer.to_string): Explicitly convert integer val to 'int', so that older GDBs do not complain about the conversion. * src/lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Give the struct a tag, so that older GDB pretty-printers have a tag to hang their hat on.
* Pretty-print const Lisp_Objects in .gdbinitPaul Eggert2017-05-061-1/+1
| | | | | | | | * src/.gdbinit (Emacs_Pretty_Printers.__call__): Compare unqualified type to Lisp_Object, to do the right thing when the expression has type ‘Lisp_Object const’. Problem reported by Eli Zaretskii in: http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00138.html
* Pacify GCC setjmp/longjmp warningPaul Eggert2017-05-061-4/+5
| | | | | | | * src/eval.c (internal_lisp_condition_case): Do not modify local var VAR, to pacify GCC’s setjmp/longjmp warning which in some cases mistakenly diagnoses VAR possibly being modified between a setjmp and a longjmp.
* ; * src/alloc.c (make_module_function): Avoid compiler warning.Eli Zaretskii2017-05-061-1/+1
|
* Introduce new misc type for module functionPhilipp Stephani2017-05-065-39/+63
| | | | | | | | | | | | | | | | | | | | This resolves a couple of FIXMEs in emacs-module.c. * src/lisp.h (MODULE_FUNCTIONP, XMODULE_FUNCTION): New functions. * src/alloc.c (make_module_function): New function. (mark_object): GC support. * src/data.c (Ftype_of, syms_of_data): Handle module function type. * src/print.c (print_object): Print support for new type. * src/emacs-module.c (module_make_function, Finternal_module_call): Use new module function type, remove FIXMEs. (module_format_fun_env): Adapt and give it external linkage. * test/src/emacs-module-tests.el (module-function-object): Add unit test.
* * src/fileio.c (write_region): Don't say "1 characters". (Bug#26796)Eli Zaretskii2017-05-061-5/+11
|
* Turn on GC_CHECK_MARKED_OBJECTS by default under ENABLE_CHECKINGEli Zaretskii2017-05-061-6/+12
| | | | | | | * src/alloc.c (GC_CHECK_MARKED_OBJECTS): Define to 1 by default of ENABLE_CHECKING is defined. (mark_object): Test for GC_CHECK_MARKED_OBJECTS being non-zero, instead of being defined.
* Pretty-print Lisp_Object values in GDBPaul Eggert2017-05-051-0/+57
| | | | | | | * src/.gdbinit: Add a pretty-printer for Lisp_Object values. Now, GDB displays them as "XIL(0xXXX)" rather than displaying them as "..." when CHECK_LISP_OBJECT_TYPE is in effect and as "DDDDD" otherwise.
* Use ptrdiff_t, not int, for stack sizesPaul Eggert2017-05-022-2/+2
| | | | | | * src/thread.c (invoke_thread_function): * src/xterm.c (x_cr_export_frames): Don’t assume SPECPDL_INDEX fits in ‘int’.
* Check list object type if --enable-gcc-warningsPaul Eggert2017-05-021-52/+53
| | | | | | | | | | | | * configure.ac (--enable-check-lisp-object-type): Default to "yes" if --enable-gcc-warnings is not "no". * etc/NEWS: Mention this. * src/eval.c (internal_lisp_condition_case): Fix some glitches with 'volatile' uncovered by the above: in particular, 'clauses' should be a pointer to volatile storage on the stack, and need not be volatile itself. Use an int, not ptrdiff_t, to count clauses. Don’t bother gathering binding count if VAR is nil. Use more-specific local names to try to clarify what’s going on.
* Constrain non-child frames to screen area in OS XCharles A. Roelli2017-05-021-1/+34
| | | | | | | * src/nsterm.m (constrainFrameRect:toScreen:): Constrain non-child frames in OS X, if they would otherwise go offscreen. Fixes: debbugs:25818
* Avoid compilation warningsEli Zaretskii2017-05-025-10/+10
| | | | | | | | | | * src/w32fns.c (Fx_file_dialog, w32_parse_and_hook_hot_key): * src/w32term.c (x_draw_glyph_string): * src/w32fns.c (compute_tip_xy): * src/w32font.c (w32font_text_extents): * src/w32menu.c (set_frame_menubar): * src/search.c (Freplace_match): Avoid compiler warnings in optimized builds.
* Merge from gnulibPaul Eggert2017-05-011-4/+2
| | | | | | | | | | | | | | This incorporates: 2017-05-01 New module 'localtime-buffer' 2017-04-30 utimens: Add support for native Windows * admin/merge-gnulib (AVOIDED_MODULES): Add tzset. * configure.ac (tzset): No need for Emacs itself to check now. * lib/gettimeofday.c, lib/time.in.h, lib/time_rz.c, lib/utimens.c: * m4/gettimeofday.m4, m4/time_h.m4, m4/time_rz.m4: Copy from gnulib. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate. * lib/localtime-buffer.c, lib/localtime-buffer.h: * m4/localtime-buffer.m4: New files, copied from gnulib. * src/editfns.c (init_editfns): Assume tzset is callable.
* Warn about missing backslashes during loadPhilipp Stephani2017-05-011-0/+40
| | | | | | | | | | | | | | | | * src/lread.c (load_warn_unescaped_character_literals, Fload, read1) (syms_of_lread): Warn if unescaped character literals are found (Bug#20152). * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Check for unescaped character literals during byte compilation. * test/src/lread-tests.el (lread-tests--unescaped-char-literals): New unit test. (lread-tests--with-temp-file, lread-tests--last-message): Helper functions for unit test. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--unescaped-char-literals): New unit test. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--with-temp-file): Helper macro for unit test.