Nicolás Bértolo [Mon, 11 May 2020 23:43:06 +0000 (20:43 -0300)]
Load libgccjit dynamically in Windows.
* configure.ac: don't add linker flags if compiling on
Windows. Compile dynlib.c if modules or native compilation are
enabled. Always compile comp.c
* lisp/term/w32-win.el: Map 'gccjit to "libgccjit.dll" in
`dynamic-library-alist`.
* src/Makefile.in: Update comments. Update to handle changes in
configure.ac.
* src/comp.c: Add declarations of used libgccjit functions using
DEF_DLL_FN. Add calls to load_gccjit_if_necessary() where necessary.
Add `native-comp-available-p`
* src/comp.h: Remove Fnative_elisp_load. Add syms_of_comp().
* src/emacs.c (main): Always call syms_of_comp()
* src/w32.c (globals_of_w32): Clear Vlibrary_cache when starting
because the libraries loaded when dumping will not be loaded when
starting.
* src/w32fns.c: Add Qgccjit symbol.
Nicolás Bértolo [Fri, 8 May 2020 17:30:14 +0000 (14:30 -0300)]
Handle LISP_WORDS_ARE_POINTERS and CHECK_LISP_OBJECT_TYPE.
* src/comp.c: Introduce the Lisp_X, Lisp_Word, and Lisp_Word_tag
types. These types are used instead of long or long long. Use
emacs_int_type and emacs_uint_types where appropriate.
(emit_coerce): Add special logic that handles the case when
Lisp_Object is a struct. This is necessary for handling the
--enable-check-lisp-object-type configure option.
* src/lisp.h: Since libgccjit does not support opaque unions, change
Lisp_X to be struct. This is done to ensure that the same types are
used in the same binary. It is probably unnecessary since only a
pointer to it is used.
Nicolás Bértolo [Fri, 8 May 2020 19:23:10 +0000 (16:23 -0300)]
* Remove a layer of indirection for access to pure storage.
* src/comp.c: Taking the address of an array is the same as casting it
to a pointer. Therefore, the C expression `(EMACS_INT **) &pure` is in
fact adding a layer of indirection that is not necessary. The fix is
to cast the `pure` array to a pointer and store that in a void pointer
that is part of the compiled shared library.
Nicolás Bértolo [Fri, 8 May 2020 18:56:09 +0000 (15:56 -0300)]
* Handle setjmp() taking two arguments in Windows.
* src/comp.c: Add `define_setjmp_deps()` and `emit_setjmp()` which
abstract over this difference in behavior between operating systems.
WARNING: Not all cases are handled by this patch. The Mingw-64
setjmp.h header deals with many other combinations. I don't think it
is a good idea to replicate the logic of that header inside
emacs. (Maybe a few lines in the configure script could be added to
handle this problem?)
Andrea Corallo [Mon, 18 May 2020 19:51:46 +0000 (20:51 +0100)]
* Pacify with the byte-compiler
* lisp/emacs-lisp/comp.el (comp-num-cpus): New special variable.
(comp-effective-async-max-jobs): Make use of `comp-num-cpus'.
(comp-call-optim-form-call): Remove unnecessary parameter.
(comp-call-optim-func): Reflect `comp-call-optim-form-call'
parameter removal.
Andrea Corallo [Mon, 18 May 2020 18:04:07 +0000 (19:04 +0100)]
* Make the Evil happy (Bug#41374)
* lisp/emacs-lisp/comp.el (comp-never-optimize-functions):
Blacklist all primitives advised by evil-mode from trampoline
optimization.
(comp-call-optim-form-call): Prevent trampoline optimization for
recursive calls at speed 2 to respect elisp original semantic.
Andrea Corallo [Sun, 17 May 2020 12:23:59 +0000 (13:23 +0100)]
* Fix Garbage Collector for missing calle-saved regs content (Bug#41357)
* src/alloc.c (SET_STACK_TOP_ADDRESS): Do not call
__builtin_unwind_init.
(flush_stack_call_func1): Rename from 'flush_stack_call_func'.
(flush_stack_call_func): New function to spill all registers
before calling 'flush_stack_call_func1'. This to make sure the
top of the stack identified includes those registers.
Stefan Kangas [Sun, 17 May 2020 12:59:10 +0000 (14:59 +0200)]
Fix minor issues with mouse-drag-and-drop-region-show-tooltip
* lisp/mouse.el (mouse-drag-and-drop-region-show-tooltip): Fix
defcustom type to allow all valid values. Suggested by David
Ponce. (Bug#41351)
(mouse-drag-and-drop-region): Fix bug where setting
`drag-and-drop-region-show-tooltip' to 0 would still show a
tooltip.
Andrea Corallo [Sun, 17 May 2020 07:48:26 +0000 (08:48 +0100)]
* Fix bug#41346 assertion triggered while loading dump
* src/comp.c (load_comp_unit): While loading from dump lambda
fixups are still to happen here. Verify relocation coherency only
after 'top_level_run' execution.
Paul Eggert [Sun, 17 May 2020 00:04:15 +0000 (17:04 -0700)]
Don’t attempt to modify constant conses
From a patch privately suggested by Mattias Engdegård on 2020-05-11
in a followup to Bug#40671.
* admin/charsets/cp51932.awk:
* admin/charsets/eucjp-ms.awk:
Generate code that does not modify constant conses.
* doc/misc/emacs-mime.texi (Encoding Customization):
* lisp/emacs-lisp/byte-opt.el (byte-compile-side-effect-free-ops):
* lisp/frameset.el (frameset-persistent-filter-alist):
* lisp/gnus/gnus-sum.el (gnus-article-mode-line-format-alist):
Use append instead of nconc.
* lisp/language/japanese.el (japanese-ucs-cp932-to-jis-map)
(jisx0213-to-unicode):
Use mapcar instead of mapc.
* lisp/language/lao-util.el (lao-transcription-consonant-alist)
(lao-transcription-vowel-alist):
* lisp/language/tibetan.el (tibetan-subjoined-transcription-alist):
Use copy-sequence.
* test/src/fns-tests.el (fns-tests-nreverse):
(fns-tests-sort, fns-tests-collate-sort)
(fns-tests-string-version-lessp, fns-tests-mapcan):
Use copy-sequence, vector, and list.
Glenn Morris [Sat, 16 May 2020 17:29:14 +0000 (10:29 -0700)]
Merge from origin/emacs-27
b4937f64cd (origin/emacs-27) Improve documentation of manually instal... efd4e973a4 Reflect the emacs-devel ELPA/MELPA dispute in FAQ 28541674cd Consider face inheritance when checking region face backgr... e75f6be6cc Fix dired default file operation (bug#41261) 406fb0746c Fix documentation related to 'command-switch-alist'. 747e0a2523 Improve ediff readability in misterioso theme (Bug#41221) 48830c73e7 Fix a crash in handle_display_spec a37290a6f9 In x_hide_tip reset tip_last_frame for GTK+ tooltips only ... 3d81995692 Fix docstring of flymake-make-diagnostic (bug#40351) 632aa9d57a Go back to “Bahá’í” e2406ff60f * lisp/dired.el (dired-toggle-marks): Doc fix. (Bug#41097)
Stefan Kangas [Sat, 16 May 2020 13:34:47 +0000 (15:34 +0200)]
Remove Emacs 22 compat code from ediff-vers.el
* lisp/vc/ediff-vers.el (ediff-vc-revision-other-window)
(ediff-vc-working-revision): Redefine Emacs 22 compatibility
aliases as obsolete function aliases.
(ediff-vc-internal, ediff-vc-merge-internal): Don't use the now
obsolete aliases.
Stefan Kangas [Sat, 16 May 2020 13:22:54 +0000 (15:22 +0200)]
Remove some XEmacs compat code from semantic
* lisp/cedet/semantic/wisent/comp.el (wisent-ISVALID-TOKEN)
(wisent-parse-nonterminals):
* lisp/cedet/semantic/wisent/wisent.el
(wisent-item-to-string): Remove XEmacs compatibility code.
(wisent-char-p): Redefine as obsolete function alias for
'characterp'.
Eli Zaretskii [Sat, 16 May 2020 08:54:37 +0000 (11:54 +0300)]
Improve documentation of manually installing Lisp packages
* doc/emacs/building.texi (Lisp Libraries): Describe how to
manually load packages in the init file. Mention the 'site-lisp'
subdirectory of the default 'load-path'.
* doc/emacs/package.texi (Packages): Describe manual installation
of ELisp packages. Suggested by Jean-Christophe Helary
<jean.christophe.helary@traduction-libre.org>.
Tassilo Horn [Fri, 15 May 2020 20:24:29 +0000 (22:24 +0200)]
Consider face inheritance when checking region face background.
Some themes (like dracula) make the region face inherit from some
other face. If the background color of the region was inherited,
`indicate-copied-region' did the switch-point-and-mark-twice dance
which is not visible in case the region is highlighted. It just
looked like Emacs would hang for a second after M-w.
* lisp/simple.el (indicate-copied-region): Consider face inheritance
when checking region face background.
Alan Mackenzie [Fri, 15 May 2020 19:24:29 +0000 (19:24 +0000)]
CC Mode: Fix bug #40052, where a very large macro was too slow in scrolling
* lisp/progmodes/cc-engine.el (c-end-of-macro): Fix faulty cache handling,
where the upper bound of c-macro-cache was never being set.
(c-forward-comment-minus-1): New macro which terminates unwanted indefinite
backward searching with lots of escaped newlines in c-backward-single-comment.
(c-backward-single-comment, c-backward-comments): Use the new macro above.
* lisp/progmodes/cc-mode.el (c-before-change-check-unbalanced-strings)
(c-after-change-mark-abnormal-strings, c-after-change-escape-NL-in-string):
Optimize three regexps by using shy groups, thus preventing regexp stack
overflow while handling the large C Macro.
Andrea Corallo [Fri, 15 May 2020 10:43:31 +0000 (11:43 +0100)]
* Do not refuse to compile if a dynamic lambda is encountered
* lisp/emacs-lisp/comp.el (comp-lex-byte-func-p): New subst.
(comp-intern-func-in-ctxt): Do not crash if we still encounter a
non lexical scoped lambda.
* src/comp.c (load_comp_unit): Use compilaiton unit 'loaded_once'
field.
(make_subr, Fcomp__register_lambda): New functions.
(Fcomp__register_subr): Make use of 'make_subr'.
(Fnative_elisp_load): Indent.
(Fnative_elisp_load): Initialize 'lambda_gc_guard'
'lambda_c_name_idx_h' fields.
(syms_of_comp): Add Scomp__register_lambda.
* lisp/emacs-lisp/comp.el (comp-ctxt): Change
'byte-func-to-func-h' hash key test.
(comp-ctxt): Add 'lambda-fixups-h' slot.
(comp-emit-lambda-for-top-level): New function.
(comp-finalize-relocs): Never emit lambdas in pure space.
(comp-finalize-relocs): Fixup relocation indexes.
Stefan Kangas [Fri, 15 May 2020 17:55:26 +0000 (19:55 +0200)]
Delete libraries obsolete since 23.1 and 23.2
Emacs 23.2 was released 10 years ago. old-whitespace.el has a
replacement in whitespace.el and is no longer relevant. The other
libraries implement compatibility with Lucid Emacs, a modified version
of Emacs last released in the 1990s.
* lisp/obsolete/ledit.el:
* lisp/obsolete/lmenu.el:
* lisp/obsolete/lucid.el:
* lisp/obsolete/old-whitespace.el: Delete files. These libraries have
been obsolete since Emacs 23.1 or 23.2.
* etc/NEWS: Announce their deletion.
Andrea Corallo [Sun, 3 May 2020 14:11:07 +0000 (15:11 +0100)]
* Rework comp-spill-lap-function
* lisp/emacs-lisp/comp.el (comp-spill-lap-function): Move code
from to comp-intern-func-in-ctxt.
(comp-intern-func-in-ctxt): New function, this guard
in case byte-to-native-lambda-byte-func is nil.
Andrea Corallo [Sat, 2 May 2020 19:33:42 +0000 (20:33 +0100)]
* Split emit_const_lisp_obj logic
* src/comp.c (emit_lisp_obj_reloc_lval): New function.
(emit_const_lisp_obj): Rename into 'emit_lisp_obj_rval' and strip
logic for 'emit_lisp_obj_reloc_lval'.
(emit_NILP, emit_CHECK_CONS, emit_mvar_rval, emit_set_internal)
(define_CAR_CDR, define_bool_to_lisp_obj): Update for
'emit_const_lisp_obj' being renamed.
Andrea Corallo [Fri, 1 May 2020 16:32:39 +0000 (17:32 +0100)]
Update spill LAP machinery and compile anonymous lambdas
* lisp/emacs-lisp/comp.el (comp-spill-lap-function): Make use of
byte-to-native-lambdas-h and update for 'byte-to-native-func-def'.
(comp-spill-lap-function): Rework logic to retrive LAP using
'byte-to-native-lambdas-h'.
(comp-emit-for-top-level): Update for 'byte-to-native-function'.
* lisp/emacs-lisp/bytecomp.el: Add commentary on new spill LAP
mechanism.
(byte-to-native-lambda, byte-to-native-func-def): New structures.
(byte-to-native-top-level): Indent.
(byte-to-native-lambdas-h): Update doc.
(byte-compile-lapcode): Add a 'byte-to-native-lambda' instance
into byte-to-native-lambdas-h instead of just LAP.
(byte-compile-file-form-defmumble): Store into
'byte-to-native-func-def' only the byte compiled function, the LAP
will be retrived through 'byte-to-native-lambdas-h'.
(byte-compile-lambda): Return the byte compiled function.
Philipp Stephani [Thu, 14 May 2020 17:26:43 +0000 (19:26 +0200)]
Fix documentation related to 'command-switch-alist'.
While there, add a unit test to verify the behavior.
* doc/lispref/os.texi (Command-Line Arguments): Fix documentation: the
option string in 'command-switch-alist' does include leading hyphens.
Also mention that 'command-switch-alist' parsing ignores equals signs
in options.
* test/lisp/startup-tests.el
(startup-tests/command-switch-alist): New unit test.
Tino Calancha [Fri, 8 May 2020 20:14:03 +0000 (22:14 +0200)]
Combine archive-int-to-mode and tar-grind-file-mode
Add a new function, file-modes-number-to-symbolic.
Make archive-int-to-mode and obsolete alias of it; use it
to define tar-grind-file-mode (Bug#27952).
* lisp/files.el (file-modes-number-to-symbolic): New defun.
* lisp/arc-mode.el (archive-int-to-mode): Make it an obsolete alias.
* lisp/tar-mode.el (tar-grind-file-mode):
Use file-modes-number-to-symbolic.
Stefan Kangas [Wed, 13 May 2020 23:28:03 +0000 (01:28 +0200)]
; Fix warning after last change in cal-julian.el
* lisp/calendar/cal-julian.el (diary-julian-date)
(diary-astro-day-number): Silence byte-compiler warning about variable
'declared after its first use'.
João Távora [Wed, 13 May 2020 10:31:21 +0000 (11:31 +0100)]
Turn Eldoc, Xref and Project into GNU ELPA :core packages
The new packages state they require Emacs 26.3 to function, but a
small part of project.el breaks this "soft" rule: the two functions
requiring fileloop.el are incompatible with Emacs 26.3.
* lisp/jsonrpc.el: Tweak comment near Package-Requires.
* lisp/emacs-lisp/eldoc.el: Add Version and Package-Requires.
* lisp/progmodes/flymake.el: Add comment near Package-Requires.
* lisp/progmodes/project.el: Add Version and Package-Requires.
* lisp/progmodes/xref.el: Add Version and Package-Requires.
Paul Eggert [Tue, 12 May 2020 22:19:46 +0000 (15:19 -0700)]
Use proper digraphs in Bahá’í month names
* lisp/calendar/cal-bahai.el (calendar-bahai-month-name-array):
There doesn’t seem to be any disagreement in the sources I
consulted that “Mas͟híyyat” and “S͟haraf” both need an “s͟h” digraph
instead of plain “sh”.
Stefan Kangas [Fri, 24 Apr 2020 21:43:57 +0000 (23:43 +0200)]
Support sorting timer-list-mode by column (Bug#40854)
* lisp/emacs-lisp/timer-list.el (timer-list-mode)
(timer-list--idle-predicate, timer-list--next-predicate)
(timer-list--repeat-predicate)
(timer-list--function-predicate): Add support for sorting by column.
Stefan Kangas [Fri, 24 Apr 2020 21:42:37 +0000 (23:42 +0200)]
Base timer-list-mode on tabulated-list-mode (Bug#40854)
* lisp/emacs-lisp/timer-list.el (list-timers)
(timer-list-mode): Inherit from 'tabulated-list-mode' instead of
'special-mode' and make the necessary changes to support that.
Paul Eggert [Tue, 12 May 2020 00:41:16 +0000 (17:41 -0700)]
Pacify GCC 10.1.0
Pacify GCC 10.1.0 so that it does not issue false alarms
when Emacs is configured with --enable-gcc-warnings.
* src/dispnew.c (clear_glyph_row):
* src/fns.c (hash_clear):
* src/keyboard.c (append_tab_bar_item):
* src/lisp.h (vcopy):
* src/xfaces.c (get_lface_attributes_no_remap)
(Finternal_copy_lisp_face, realize_default_face):
* src/xmenu.c (set_frame_menubar):
Work around -Warray-bounds false alarm in GCC 10.1.0.
* src/intervals.c (copy_properties):
Avoid -Wnull-dereference false alarm in GCC 10.1.0.
* src/lisp.h (xvector_contents_addr, xvector_contents):
New functions, useful for working around GCC bug 95072.
Alan Mackenzie [Mon, 11 May 2020 20:05:54 +0000 (20:05 +0000)]
Fix bug #40992 whilst still allowing breakpoint highlights in edebug
Strategy: when an instrumented function gets re-evaluated, save the former
value of its symbol's `edebug' property in the new propery `ghost-edebug'. If
this function is still being edebugged, edebug will then access its info from
this new property.
Also fix the bug whereby compile-defun'ing an instrumented function prevents
the function being re-instrumented by I (edebug-instrument-callee).
* lisp/emacs-lisp/edebug.el (edebug-get-edebug-or-ghost): New function.
(edebug-read-and-maybe-wrap-form1): save value of `edebug' property in
'ghost-edebug'.
(edebug-make-form-wrapper): Set value of `ghost-edebug' to nil.
(edebug-make-form-wrapper, edebug-find-stop-point, edebug-next-break-point)
(edebug-modify-breakpoint, edebug--overlay-breakpoints, edebug-set-breakpoint)
(edebug-unset-breakpoints, edebug-toggle-disable-breakpoint)
(edebug--backtrace-goto-source, edebug-display-freq-count)
(edebug-set-conditional-breakpoint): Use edebug-get-edebug-or-ghost to access
edebug information.
(edebug-instrument-function): Also check a function is a cons before declaring
it "already instrumented".
Dmitry Gutov [Mon, 11 May 2020 01:34:55 +0000 (04:34 +0300)]
Use the "modern" toolbars in Gnus again
* lisp/gnus/gmm-utils.el (gmm-tool-bar-style):
Undo the breakage from commit d88118db37dd
(https://lists.gnu.org/archive/html/emacs-devel/2020-04/msg02094.html).
Stefan Monnier [Sun, 10 May 2020 23:07:45 +0000 (19:07 -0400)]
* lisp/emacs-lisp/pcase.el: Don't bind unused vars in branches
(pcase--fgrep): Change calling convention to take bindings rather than
just variables.
(pcase--funcall, pcase--eval): Adjust to this new calling convention.
(pcase--expand): Use `pcase--fgrep` to bind only the vars that are used.