- 24 Apr, 2019 4 commits
-
-
Philipp Stephani authored
* src/module-env-27.h: Add new module functions to convert big integers. * src/emacs-module.h.in (emacs_mpz): Define if GMP is available. * src/emacs-module.c (module_extract_big_integer) (module_make_big_integer): New functions. (initialize_environment): Use them. * test/data/emacs-module/mod-test.c (Fmod_test_double): New test function. (emacs_module_init): Define it. * test/src/emacs-module-tests.el (mod-test-double): New unit test. * doc/lispref/internals.texi (Module Values): Document new functions.
-
Philipp Stephani authored
Time values are a fundamental data type, and such conversions are hard to implement within modules because of the various forms of time values in Emacs Lisp. Adding dedicated conversion functions can significantly simplify module code dealing with times. This approach uses nanosecond precision. While Emacs in theory has support for higher-precision time values, in practice most languages and standards, such as POSIX, C, Java, and Go, have settled on nanosecond-precision integers to represent time. * src/emacs-module.h.in: Add header for struct timespec. * src/module-env-27.h: Add module functions for time conversion. * src/emacs-module.c (module_extract_time, module_make_time): New functions. (initialize_environment): Use them. * test/data/emacs-module/mod-test.c (Fmod_test_add_nanosecond): New test function. (emacs_module_init): Define it. * test/src/emacs-module-tests.el (mod-test-add-nanosecond/valid) (mod-test-add-nanosecond/nil, mod-test-add-nanosecond/invalid): New unit tests. * doc/lispref/internals.texi (Module Values): Document time conversion functions.
-
Eli Zaretskii authored
This reverts commit 64d0cd98. Rationale: any font-related code and comments, even if unused for decades, serves as important source of useful information in an area of Emacs code that is notoriously under-documented. Please do NOT remove this stuff until we have an active expert in this are on board, who will then decide whether this can be retired.
-
YAMAMOTO Mitsuharu authored
* configure.ac: Check cairo early. Don't try Xft if cairo is used. * lwlib/lwlib-utils.h [USE_CAIRO]: Include cairo.h and fontconfig.h. (XftFont, XftDraw, XftColor, XGlyphInfo) [USE_CAIRO]: New typedefs. (XftFontOpenName, XftFontClose, XftDrawCreate, XftDrawDestroy) (XftDrawRect, XftDrawStringUtf8, XftTextExtentsUtf8) [USE_CAIRO]: New macros. (crxft_font_open_name, crxft_font_close, crxft_draw_create) (crxft_draw_rect, crxft_draw_string, crxft_text_extents) [USE_CAIRO]: New externs. * lwlib/lwlib-utils.c [USE_CAIRO]: Include math.h, cairo-ft.h, and cairo-xlib.h. (crxft_font_open_name, crxft_font_close, crxft_draw_create) (crxft_set_source_color, crxft_draw_rect, crxft_draw_string) (crxft_text_extents) [USE_CAIRO]: New Xft compatibility functions. * lwlib/xlwmenuP.h [USE_CAIRO]: Include lwlib-utils.h. * lwlib/xlwmenu.c (display_menu_item) [USE_CAIRO]: Call cairo_surface_mark_dirty and cairo_surface_flush. * lwlib/lwlib-Xaw.c [USE_CAIRO]: Include stdlib.h and lwlib-utils.h. (draw_text) [USE_CAIRO]: Call cairo_surface_flush. * src/xsettings.c [USE_CAIRO]: Include fontconfig.h (apply_xft_settings) [!HAVE_XFT]: Don't call XftDefaultSubstitute or XftDefaultSet. * lwlib/lwlib-Xaw.c: * lwlib/lwlib-int.h: * lwlib/xlwmenu.c: * lwlib/xlwmenuP.h: * src/xrdb.c: * src/xsettings.c: * src/xterm.c: Replace all #ifdef HAVE_XFT with #if defined USE_CAIRO || defined HAVE_XFT. * src/xfns.c (x_default_font_parameter): Replace #ifdef HAVE_XFT with #if defined USE_CAIRO || defined HAVE_XFT.
-
- 23 Apr, 2019 17 commits
-
-
Stefan Monnier authored
Enable lexical-binding. (cl-print-compiled, cl-print-compiled-button): Declare. (timer-list-mode): Add spacing to align the header.
-
Philipp Stephani authored
-
Paul Eggert authored
These directives are in files that are compiled only if the symbols are defined. * src/gfilenotify.c: Remove unnecessary ‘#ifdef HAVE_GFILENOTIFY’. * src/inotify.c: Remove unnecessary ‘#ifdef HAVE_INOTIFY’. * src/kqueue.c: Remove unnecessary ‘#ifdef HAVE_KQUEUE’.
-
Stefan Monnier authored
-
Paul Eggert authored
* src/font.c (LSTRING_HEADER_SIZE, LSTRING_GLYPH_SIZE, check_gstring) (check_otf_features, otf_list, otf_tag_symbol, otf_open) (font_otf_capability, generate_otf_features) (font_otf_DeviceTable, font_otf_ValueRecord) (font_otf_Anchor, Ffont_drive_otf, Ffont_otf_alternates) (Fdraw_string, syms_of_font): Remove "experimental and not tested much" code that has been "#if 0"-ed out for more than a decade and which was getting in the way of maintenance.
-
Philipp Stephani authored
This provides more debugging hints for callers. * src/emacs-module.c (module_copy_string_contents): Use three-argument form of args-out-of-range.
-
Philipp Stephani authored
INT_TO_INTEGER is more obviously correct and means we don’t have to worry about data type sizes and signedness. * src/json.c (json_parse_error): Use INT_TO_INTEGER. The tiny performance gain of make_fixed_natnum isn’t worth the trouble then signaling an error.
-
Mattias Engdegård authored
* lisp/autorevert.el (auto-revert-notify-watch-descriptor-hash-list): Rename to auto-revert--buffers-by-watch-descriptor. Improved doc string. (auto-revert-notify-rm-watch, auto-revert-notify-add-watch, auto-revert-notify-handler): Use new name.
-
Michael Albinus authored
* doc/lispref/processes.texi (Asynchronous Processes): (Accepting Output): Remote processes cannot use a pipe process for stderr.
-
Philipp Stephani authored
-
Eli Zaretskii authored
Thanks to Dmitry Gutov <dgutov@yandex.ru> for running many benchmarks and for useful discussions. * src/json.c (json_make_string): Speed up parsing of JSON strings by optimizing the normal case of a valid UTF-8 string being returned from libjansson. (Bug#31138)
-
Philipp Stephani authored
* test/src/json-tests.el (json-parse-string/null): Make JSON object syntactically valid. This test is supposed to check whether an escaped null character causes an error, but without quoting the string it would be syntactically invalid in any case.
-
Alan Mackenzie authored
* lisp/progmodes/cc-fonts.el (c-font-lock-complex-decl-prepare) (c-font-lock-objc-methods) (c-font-lock-declarations, c-font-lock-enum-tail) (c-font-lock-cut-off-declarators, c-font-lock-enclosing-decls): If the chunk been fontified consists entirely of comments and strings, don't attempt to perform the function's action. * lisp/progmodes/cc-mode.el (c-before-change-check-unbalanced-strings): Don't expand (c-new-BEG c-new-END) unnecessarily to the entire raw string being fontified. (c-fl-decl-start, c-fl-decl-end): When in a (raw or otherwise) string, don't return a position outside of the string (which used to cause unneeded fontification).
-
YAMAMOTO Mitsuharu authored
* lwlib/lwlib-int.h (struct _widget_instance) [HAVE_XFT]: Remove nr_xft_data. * lwlib/lwlib-Xaw.c (find_xft_data, xaw_update_one_widget) [HAVE_XFT]: Loop while widget member is not NULL instead of using nr_xft_data. (xaw_destroy_instance) [HAVE_XFT]: Move xft_data release code from here ... (destroy_xft_data) [HAVE_XFT]: ... to here. (make_dialog) [HAVE_XFT]: Add destroy_xft_data as destroy callback for dialog.
-
Paul Eggert authored
* Makefile.in (top_distclean): Clean makefile as well as Makefile. * configure.ac: If not using plain ‘make’, create a makefile so that plain ‘make’ simply calls $(MAKE).
-
Paul Eggert authored
Stefan Monnier pointed out examples like (funcall `(closure ,(let ((cycle (list nil))) (setcdr cycle cycle)) () a)), where the user can set Vinternal_interpreter_environment indirectly. * src/eval.c (Fsetq): Revert recent change, going back to Fassq.
-
Paul Eggert authored
* etc/DEBUG: Improve -gdwarf-N documentation. Go into more detail about UndefinedBehaviorSanitizer.
-
- 22 Apr, 2019 19 commits
-
-
Paul Eggert authored
* src/eval.c (Fsetq, eval_sub): Use assq_no_quit instead of Fassq for a list that cannot contain cycles or be that long.
-
Paul Eggert authored
* src/conf_post.h (__has_attribute_warn_unused_result): New macro for compilers lacking __has_attribute. * src/systhread.h (__has_attribute): Remove ineffective define. (ATTRIBUTE_WARN_UNUSED_RESULT): Work better on GCC 3.4 thru 4.
-
Paul Eggert authored
Although the lisp.h macros really need improvement, INTEGER_TO_INT is not the right way to go about it, as it causes conversion from intmax_t to uintmax_t and back again, which can cause a signal if the value is negative. * src/lisp.h (INTEGER_TO_INT, ranged_integer_to_int) (ranged_integer_to_uint): Remove, reverting recent changes to this file. * src/json.c (lisp_to_json): Revert to previous code, as the change messes up with uintmax_t<->intmax_t conversion.
-
Philipp Stephani authored
-
Mattias Engdegård authored
* lisp/autorevert.el (auto-revert-notify-handler): When getting a `stopped' event, deal with it for the buffers it applies to, rather than for all buffers in auto-revert mode.
-
Mattias Engdegård authored
-
Mattias Engdegård authored
This reverts commit e9e807e9, which is no longer necessary as `file-notify-rm-watch' has been made robust against reentry.
-
Mattias Engdegård authored
Allow file-notify callbacks to call `file-notify-rm-watch', harmlessly, after receiving a `stopped' event without triggering recursion. * lisp/filenotify.el (file-notify--watch): Note that `callback' can be nil. (file-notify--rm-descriptor): Set the `callback' field to nil before sending `stopped'. (file-notify-rm-watch): Don't do anything if the `callback' field is nil.
-
Philipp Stephani authored
This is similar to CONS_TO_INTEGER. The inverse (INT_TO_INTEGER) already exists. * src/lisp.h (INTEGER_TO_INT): New macro. (ranged_integer_to_int, ranged_integer_to_uint): New functions. * src/json.c (lisp_to_json): Use helper macro.
-
Philipp Stephani authored
* doc/lispref/processes.texi (Asynchronous Processes): Document existence and properties of the standard error process. (Accepting Output): Document that one has to accept output from the standard error process separately.
-
Philipp Stephani authored
* emacs-module.c (module_make_string): Use make_unibyte_string, which doesn’t require its argument to be null-terminated. Since it always returns a heap-allocated string, we don’t have to copy it any more while decoding. (module_decode): New helper function.
-
Philipp Stephani authored
Factor out conversions into helper functions to provide a simpler interface. * src/emacs-module.c (module_encode, module_decode_copy): New helper functions. (module_make_function, module_copy_string_contents) (module_make_string): Use them.
-
Basil L. Contovounesios authored
For discussion, see thread starting at: https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00316.html * doc/lispref/customize.texi (Composite Types): Do not overspecify :match-alternatives predicates. * doc/lispref/eval.texi (Intro Eval): Anchor definition of "side effect" for cross-referencing... * doc/lispref/functions.texi (What Is a Function): ...from here. Define what a pure function is. * doc/lispref/internals.texi (Writing Emacs Primitives): Describe currently preferred approach to marking primitives as pure and side-effect-free. * doc/lispref/symbols.texi (Standard Properties): Expand description of pure and side-effect-free properties.
-
Philipp Stephani authored
Now that CATCHER_ALL catches signals as well, we can simplify MODULE_HANDLE_NONLOCAL_EXIT a bit. * src/emacs-module.c (MODULE_SETJMP, MODULE_SETJMP_1): Remove. (MODULE_HANDLE_NONLOCAL_EXIT): Inline MODULE_SETJMP and MODULE_SETJMP_1.
-
Eli Zaretskii authored
-
Michael Albinus authored
* test/lisp/net/tramp-tests.el (tramp-test32-shell-command): Check for backward compatibility. (tramp-test33-environment-variables): Apply a better check for unset variable.
-
Paul Eggert authored
* etc/DEBUG: Modernize for AddressSanitizer etc. * etc/NEWS: Defer to etc/DEBUG for this.
-
Paul Eggert authored
It doesn’t work anymore, and these days ‘gcc -fsanitize=address’ does a better job anyway. * configure.ac: Remove the option. * configure.ac (ac_xmalloc_overrun, XMALLOC_OVERRUN_CHECK): * src/alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD) (XMALLOC_OVERRUN_CHECK_SIZE, XMALLOC_OVERRUN_SIZE_SIZE) (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer) (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc) (overrun_check_realloc, overrun_check_free): Remove. All uses removed. * etc/NEWS: Mention this.
-
Paul Eggert authored
* configure.ac: Remove the option. * configure.ac (ac_gc_check_cons_list, GC_CHECK_CONS_LIST): * src/alloc.c (check_cons_list) [GC_CHECK_CONS_LIST]: * src/lisp.h (lisp_h_check_cons_list, check_cons_list): Remove. All uses removed. * etc/NEWS: Mention this.
-