summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2020-04-01Fix compilation with CHECK_STRUCTSAndreas Schwab
* src/pdumper.c (dump_buffer): Update hash of struct buffer.
2020-03-31Remove `all_buffers` and the associated `next` field of buffersStefan Monnier
* src/alloc.c (enum mem_type): Remove MEM_TYPE_BUFFER. (allocate_buffer): Allocate like any other pseudovector. Don't register on `all_buffers` any more. (live_buffer_holding, live_buffer_p): Delete functions. (mark_maybe_object, valid_lisp_object_p): Don't pay attention to MEM_TYPE_BUFFER any more. (garbage_collect): Only compact the live buffers. (mark_buffer): Mark the undo_list of dead buffers here. (mark_object): Buffers are normal pseudovectors now. (sweep_buffers): Don't do the actual sweep here, just cleanup the markers and only for live buffers. * src/buffer.c (all_buffers): Remove variable. (Fkill_buffer): Don't check indirect dead buffers. Set the undo_list before we remove ourselves from the list of live buffers. (Fbuffer_swap_text, Fset_buffer_multibyte): Don't check indirect dead buffers. (init_buffer_once): Don't set `all_buffers`. (init_buffer): Don't map new memory for dead buffers. * src/buffer.h (struct buffer): Remove `next` field. (FOR_EACH_BUFFER): Remove macro. * src/pdumper.c (dump_buffer): Don't dump the `next` field.
2020-03-30Merge from origin/emacs-27Glenn Morris
c6e0981b96 (origin/emacs-27) * lisp/image/image-converter.el: Fix cus... 461bd9cc20 Fix url-cookie.el for lexical binding f3ccfb1926 ; * src/decompress.c: Fix comment style. 1af03e7e92 ; * src/xfaces.c (syms_of_xfaces): Fix wording and typo. 93945fcd19 ; * test/lisp/calc/calc-tests.el: Fix mistake in last commit ee47e00f4e Don't suggest setting face-remapping-alist to a literal (B... c2b8ce4439 Calc: don't treat nil as an integer (bug#40155) e1f0e08922 * lisp/files.el (directory-files-recursively): Doc fix. (... 02b3820315 Document how to disable Tramp file archives
2020-03-30Avoid assertion violation at startup in pdumped EmacsEli Zaretskii
* src/buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Remove the assertion that ensured all buffers in pdumped Emacs have non-NULL pointer to buffer text. That was false when Emacs was pdumped with killed buffer(s) in the all_buffers linked list. See https://lists.gnu.org/archive/html/emacs-devel/2020-03/msg00800.html for more details.
2020-03-29; * src/decompress.c: Fix comment style.Eli Zaretskii
2020-03-29; * src/xfaces.c (syms_of_xfaces): Fix wording and typo.Eli Zaretskii
2020-03-29Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo
2020-03-29Prevent collisions in C namespace and function shadowingAndrea Corallo
This rework make functions being indexed by their unique C symbol name preventing multiple lisp function with the same name colliding.
2020-03-29* comp.c (maybe_defer_native_compilation): Compile comp dependecies.Andrea Corallo
Make maybe_defer_native_compilation able to compile comp dependecies breaking circularity.
2020-03-29src/comp.c (Fcomp__init_ctxt): AestheticAndrea Corallo
2020-03-28Don't suggest setting face-remapping-alist to a literal (Bug#39812)Noam Postavsky
* src/xfaces.c (syms_of_xfaces) <face-remapping-alist>: Use copy-tree in the costring example code, and note why.
2020-03-28Stop using newly-deprecated dosname Gnulib modulePaul Eggert
Code is supposed to use the filename module now. * admin/merge-gnulib (GNULIB_MODULES): Replace dosname with filename. * lib/dosname.h: Remove this forwarding stub. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate. * lib-src/emacsclient.c, src/fileio.c: Include filename.h instead of dosname.h.
2020-03-27Use ATTRIBUTE_CONST for some bignum functionsPaul Eggert
* src/bignum.h (mpz_get_d_rounded): * src/lisp.h (bignum_to_double, bignum_to_intmax) (bignum_to_uintmax, bignum_bufsize): Declare as ATTRIBUTE_CONST.
2020-03-27Treat out-of-range positions consistentlyPaul Eggert
If a position argument to get-byte etc. is an out-of-range integer, treat it the same regardless of whether it is a fixnum or a bignum. * src/buffer.c (fix_position): New function. * src/buffer.c (validate_region): * src/character.c (Fget_byte): * src/coding.c (Ffind_coding_systems_region_internal) (Fcheck_coding_systems_region): * src/composite.c (Ffind_composition_internal): * src/editfns.c (Fposition_bytes, Fchar_after, Fchar_before) (Finsert_buffer_substring, Fcompare_buffer_substrings) (Fnarrow_to_region): * src/fns.c (Fsecure_hash_algorithms): * src/font.c (Finternal_char_font, Ffont_at): * src/fringe.c (Ffringe_bitmaps_at_pos): * src/search.c (search_command): * src/textprop.c (get_char_property_and_overlay): * src/window.c (Fpos_visible_in_window_p): * src/xdisp.c (Fwindow_text_pixel_size): Use it instead of CHECK_FIXNUM_COERCE_MARKER, so that the code is simpler and treats bignums consistently with fixnums. * src/buffer.h (CHECK_FIXNUM_COERCE_MARKER): Define here rather than in lisp.h, and reimplement in terms of fix_position so that it treats bignums consistently with fixnums. * src/lisp.h (CHECK_FIXNUM_COERCE_MARKER): Move to buffer.h. * src/textprop.c (validate_interval_range): Signal with original bounds rather than modified ones.
2020-03-26Refactor and fix typo in CHECK_*_COERCE_MARKERPaul Eggert
* src/data.c (check_integer_coerce_marker) (check_number_coerce_marker): New functions. Also, fix a typo in the former, by having it use Qinteger_or_marker_p not Qnumber_or_marker_p. (arithcompare, floatop_arith_driver, bignum_arith_driver) (arith_driver, Fplus, Fminus, Ftimes, Fquo, Frem, Fmod) (minmax_driver, Flogand, Flogior, Flogxor, Fadd1, Fsub1): Use them in place of the similarly-named macros. * src/lisp.h (CHECK_NUMBER_COERCE_MARKER) (CHECK_INTEGER_COERCE_MARKER): Remove; no longer used.
2020-03-26Add a module function to open a file descriptor connected to a pipe.Philipp Stephani
A common complaint about the module API is that modules can't communicate asynchronously with Emacs. While it isn't possible to call arbitrary Emacs functions asynchronously, writing to a pipe should always be fine and is a pretty low-hanging fruit. This patch implements a function that adapts an existing pipe process. That way, users can use familiar tools like process filters or 'accept-process-output'. * src/module-env-28.h: Add 'open_channel' module function. * src/emacs-module.c (module_open_channel): Provide definition for 'open_channel'. (initialize_environment): Use it. * src/process.c (open_channel_for_module): New helper function. (syms_of_process): Define necessary symbol. * test/src/emacs-module-tests.el (module/async-pipe): New unit test. * test/data/emacs-module/mod-test.c (signal_system_error): New helper function. (signal_errno): Use it. (write_to_pipe): New function running in the background. (Fmod_test_async_pipe): New test module function. (emacs_module_init): Export it. * doc/lispref/internals.texi (Module Misc): Document new module function. * doc/lispref/processes.texi (Asynchronous Processes): New anchor for pipe processes. * etc/NEWS: Document 'open_channel' function.
2020-03-26Remove COERCE_MARKERPaul Eggert
* src/xdisp.c (COERCE_MARKER): Remove. All uses replaced by Fmarker_position; this is simpler as the macro was invoked only on markers.
2020-03-25line-beginning-position args can be bignumsPaul Eggert
* src/editfns.c (Fline_beginning_position, Fline_end_position): Do not restrict integer arguments to fixnums.
2020-03-25Fix integer overflow in internal_self_insertPaul Eggert
* src/cmds.c (internal_self_insert): Avoid undefined behavior on integer overflow by using saturated add.
2020-03-25Fix integer overflow in forward-pointPaul Eggert
* lisp/subr.el (forward-point): Rewrite in Lisp and move here ... * src/cmds.c (Fforward_point): ... from here. This fixes an integer overflow bug with (forward-point most-positive-fixnum).
2020-03-25Pacify --enable-gcc-warnings for lock_filePaul Eggert
* src/filelock.c (lock_file): Pacify gcc -Wmaybe-uninitialized after recent change to this function.
2020-03-24* comp.c (emit_mvar_access): Fix speed 1 compilationAndrea Corallo
At speed 1 propagate does not run and all mvars are allocated in array 0.
2020-03-23Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo
2020-03-23Guard against function redefinition during deferred loadAndrea Corallo
2020-03-23Merge from origin/emacs-27Glenn Morris
d66331aea4 (origin/emacs-27) Don't build the Gnulib 'utimens' module ... f2351a689b Add Harfbuzz dependency 8944310d7c Don't signal during backtrace unrewind (Bug#40088) 8709aaddd8 Fix a couple of problems in changelog generating functions 9ab85f087f Fix cl-concatenate (Bug#40180) 561e9fb91b Improve documentation of project.el commands b28a9a6cc3 Make svg images with links valid 7515252cce * lisp/tab-line.el (tab-line-new-button-show): New defcustom. # Conflicts: # etc/NEWS # nt/gnulib-cfg.mk
2020-03-23Merge from origin/emacs-27Glenn Morris
bed04c502c Use correct registry name for windows-1251 charset 1aa1529301 ERC: Update maintainer address
2020-03-22Don't signal during backtrace unrewind (Bug#40088)Noam Postavsky
backtrace_eval_unrewind is used to temporarily reverse let-bindings (it's called with a positive argument to reverse bindings, and then a negative argument to re-apply them) by backtrace--locals and backtrace-eval. For the SPECPDL_LET_DEFAULT and SPECPDL_LET_LOCAL cases (which occur for let-bindings on buffer-local variables), the code calls Fdefault_value and Fbuffer_local_value on the symbol. For symbols which are unbound at top-level, the first (with positive argument) call to backtrace_eval_unrewind will set the symbol's value to unbound (putting the current value in the specpdl's "old value" slot). On the second (with negative argument) call, backtrace_eval_unrewind attempts to retrieve the symbol's value with Fdefault_value or Fbuffer_local_value, but that raises a void-variable signal. This interrupts the restoration of the let-bindings, so any other variables more recent on the stack will now have the wrong value. * src/data.c (default_value): Make non-static. * src/lisp.h: Declare it. * src/eval.c (backtrace_eval_unrewind): Replace the calls to Fdefault_value and Fbuffer_local_value with default_value and buffer_local_value, respectively. The latter do exactly the same as the former, except if the symbol's value is Qunbound they just return it instead of signaling void-variable.
2020-03-22Avoid extra "changed on disk" prompt in save-buffer (Bug#18336)Noam Postavsky
* src/filelock.c (lock_file): Don't query the user if the current session already owns the lock.
2020-03-22* comp.c (maybe_defer_native_compilation): FixAndrea Corallo
Prevent recursive compilation while deferring compilation.
2020-03-22* comp.c (maybe_defer_native_compilation): Add some debug codeAndrea Corallo
2020-03-19Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo
2020-03-19Fix display of :box face when overlay strings are aroundEli Zaretskii
* src/xdisp.c (reset_box_start_end_flags): New function. (handle_face_prop): Only set the start_of_box_run_p flag, don't reset it. (pop_it): Set the face_box_p flag, if the popped face requires that, when continuing iteration over buffer text. (get_next_display_element, next_element_from_display_vector): Only set the end_of_box_run_p flag, never reset it here. (set_iterator_to_next): Don't reset the start_of_box_run_p and end_of_box_run_p flags here. They are now reset as side effect of PRODUCE_GLYPHS. (append_space_for_newline): Restore the end_of_box_run_p flag after PRODUCE_GLYPHS where we previously didn't reset it. * src/dispextern.h (PRODUCE_GLYPHS): Call reset_box_start_end_flags after producing glyphs. (Bug#40124)
2020-03-19Use correct registry name for windows-1251 charsetRobert Pluim
* src/ftfont.c (fc_charset_table): The registry to use to lookup windows-1251 charset is microsoft-cp1251, not windows-1251. (Bug#40097)
2020-03-19Tiny simplification of frac_to_doublePaul Eggert
* src/timefns.c (frac_to_double): Remove unnecessary runtime check, since the denominator is always positive.
2020-03-19Omit timestamp optimization invalid on 387 FPUPaul Eggert
* src/timefns.c (frac_to_double): Omit optimization that is invalid on machines with excess precision (e.g., gcc x86 with 387 FPU), because it double-rounds. Found via ‘gcc -m32’ on x86-64.
2020-03-18* comp.c (native-elisp-load): Guard against misisng file.Andrea Corallo
2020-03-19Command late load when deferring compilationAndrea Corallo
2020-03-19Extend low level code for late loadAndrea Corallo
2020-03-18Merge from origin/emacs-27Glenn Morris
e92b8e535a (origin/emacs-27) Remove raw carriage return characters fr... 5747a59a88 Recalculate default font when switching font backend a2dd8c4234 * lisp/tab-line.el: Fix tab-line-format and tab-line-forma... a7b8291b6c * etc/NEWS: Make the `--eval` example slightly more precise f8254aad14 * lisp/image/image-converter.el: Support more ImageMagick ... 5beb269505 Support Unicode 13.0 3a671ad7ed Fix regression in wisent-total-conflicts # Conflicts: # etc/NEWS
2020-03-18Merge from origin/emacs-27Glenn Morris
3a8a231810 * lisp/textmodes/fill.el (fill-nobreak-predicate): Fix doc... cbe643104d Improve Package Menu hiding docstrings 8d28c98ae0 Fix display of Big5 characters when using Fontconfig
2020-03-17Don't generate useless range table entries for ASCII charsMattias Engdegård
In multibyte regexps, each ASCII char or range in a character alternative produces a nonsense range table entry in addition to the correct bits in the ASCII bitmap. Those entries do not match anything but waste space and time. * src/regex-emacs.c (regex_compile): Don't generate reversed intervals.
2020-03-17Recalculate default font when switching font backendRobert Pluim
This is an updated version of the patch by Dmitry Antipov <dmantipov@yandex.ru> in <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=23386#43>. Fixes Bug#23386 * src/dispextern.h (struct redisplay_interface): New member default_font_parameter. * src/xterm.h: Add prototype for x_default_font_parameter. * src/xterm.c (x_redisplay_interface): Initialize default_font_parameter member. * src/xfns.c (x_default_font_parameter): Make non-static. * src/w32term.h: Add prototype for w32_default_font_parameter * src/w32fns.c (w32_default_font_parameter): Make non-static. * src/w32term.c (w32_redisplay_interface): Initialize default_font_parameter member. * src/nsterm.m (ns_redisplay_interface): Add dummy ns_default_font_parameter (there is currently only one possible font backend on macOS). Initialize default_font_parameter member. * src/frame.c (gui_set_font_backend): Recalculate default font using RIF default_font_parameter to avoid crash when changing font backend.
2020-03-16Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo
2020-03-16Trigger native compilation when loading bytecodeAndrea Corallo
Introduce a first mechanism to trigger compilation when lex elc files are loaded. This is off by default and has to be better tested.
2020-03-15Reverse the meaning of 2nd arg to 'live_buffer_holding'Eli Zaretskii
* src/alloc.c (live_buffer_holding): Rename ALL_BUFFERS ti IGNORE_KILLED, and reverse the condition for returning killed buffers. (live_buffer_p): Add commentary. (live_buffer_p, mark_maybe_object, mark_maybe_pointer): Reverse the 2nd argument to live_buffer_holding. (Bug#39962)
2020-03-15Make sure we mark reachable killed buffers during GCPip Cet
* src/alloc.c (live_buffer_holding): Add ALL_BUFFERS argument for returning killed buffers. (mark_maybe_object, mark_maybe_pointer): Use the additional argument. (Bug#39962)
2020-03-14Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo
2020-03-14Fix make bootstrap for native compilationAndrea Corallo
Add Makefile target native-compile-clean removing all eln output folders. This is also triggered by make bootstrap to perform a clean bootstrap. Also revert some modification of the build system against master not effective anymore with the new directory layout.
2020-03-14Fix display of Big5 characters when using FontconfigEli Zaretskii
* src/ftfont.c (fc_charset_table): Fix the value of the big-5 representative codepoint. Reported by Brian Schack <bschack-cocoa@usa.net>. (Bug#40057) * src/macfont.m (cf_charset_table): Adjust the comment.
2020-03-13Prefix native compilation folders with "eln-"Andrea Corallo