Commit graph

6905 commits

Author SHA1 Message Date
Andrea Corallo
89f064104c * Some clean-up in comp.el
* lisp/emacs-lisp/comp.el (comp-emit-cond-jump, comp-emit-switch)
	(comp-limplify-block, comp-compute-edges)
	(comp-ssa-rename, comp-fwprop*, comp-effective-async-max-jobs)
	(comp-run-async-workers): Respect max 80 columns.
	(batch-byte-native-compile-for-bootstrap): Improve doc + remove
	some now unnecessary error handling.
2020-09-29 17:14:22 +02:00
Andrea Corallo
3129b3ffcb Rename in docstrings "non nil" into "non-nil"
* lisp/emacs-lisp/comp.el: Rename non nil -> non-nil in doc.

	* src/comp.c: Likewise.
2020-09-28 21:09:00 +02:00
Andrea Corallo
a06fe08e8e Clean-up some now unnecessary diff against master
* lisp/emacs-lisp/autoload.el (update-directory-autoloads):
	.eln files have been moved so remove the '.eln' match.

	* lisp/emacs-lisp/bytecomp.el (byte-compile-refresh-preloaded):
	Likewise.

	* lisp/emacs-lisp/find-func.el (find-library-suffixes): Clean-up
	as '.eln' is no more in `load-suffixes'.

	* lisp/help-fns.el (find-lisp-object-file-name): Clean-up as
	`symbol-file' will return the '.elc' file.

	* src/lread.c (Fget_load_suffixes): Remove logic as '.eln' is not
	anymore in load-suffixes.
	(openp): Two spaces.
2020-09-29 10:05:39 +02:00
Andrea Corallo
29a8d9303b * lisp/emacs-lisp/cl-macs.el (cl--optimize): Add a FIXME. 2020-09-26 15:32:21 +02:00
Andrea Corallo
06acf681d6 Merge remote-tracking branch 'savannah/master' into HEAD 2020-09-26 15:31:50 +02:00
Mattias Engdegård
497a1ed8bb string-search robustness and documentation improvement (bug#43598)
* src/fns.c (Fstring_search): Check START-POS argument range.
Simplify logic.  Improve doc string.
* test/src/fns-tests.el (string-search): Add test cases.
* doc/lispref/strings.texi (Text Comparison): Elaborate.
* lisp/emacs-lisp/byte-opt.el (pure-fns): Mark string-search as pure.
2020-09-25 17:08:00 +02:00
Lars Ingebrigtsen
79762ffa61 Mark string-search as being side effect free
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Add
string-search.
2020-09-25 14:30:13 +02:00
Andrea Corallo
e5b052d60d Rename comp--subr-safe-advice -> comp-subr-safe-advice
* lisp/emacs-lisp/comp.el (comp-subr-safe-advice): Rename
	comp--subr-safe-advice -> comp-subr-safe-advice.
	* lisp/emacs-lisp/nadvice.el (advice--add-function): Likewise.
	* lisp/emacs-lisp/advice.el (ad-add-advice): Likewise.
2020-09-24 09:57:17 +02:00
Andrea Corallo
6d83902ffd * lisp/emacs-lisp/comp.el (comp-body-eff): Improve style. 2020-09-24 09:57:17 +02:00
Andrea Corallo
94736c413f Do not install a subr trampoline twice
* src/comp.c (syms_of_comp): Define and initialize
	'Vcomp_installed_trampolines_h'.
	(Fcomp__install_trampoline): Fill 'Vcomp_installed_trampolines_h'
	* lisp/emacs-lisp/comp.el (comp--subr-safe-advice): Make use of
	`comp-installed-trampolines-h' to guard against installing a
	trampoline twice.
2020-09-24 09:57:17 +02:00
Andrea Corallo
b94a0a931e * lisp/emacs-lisp/comp.el (comp-never-optimize-functions): Clean-up. 2020-09-24 09:57:17 +02:00
Andrea Corallo
db354ffd57 Call `comp--subr-safe-advice' from the advice machinery
* lisp/emacs-lisp/nadvice.el (advice--add-function): Call
	`comp--subr-safe-advice' when necessary.

	* lisp/emacs-lisp/advice.el (ad-add-advice): Likewhise.
2020-09-24 09:57:17 +02:00
Andrea Corallo
3ec1b932c9 * Add `comp--subr-safe-advice' entry point
Add a Lisp side entry-point to be called to make primitive adivicing
effective.

	* lisp/emacs-lisp/comp.el (comp-trampoline-sym)
	(comp-trampoline-filename): New substs.
	(comp-make-lambda-list-from-subr, comp-search-trampoline)
	(comp-tampoline-compile): New functions
2020-09-24 09:57:17 +02:00
Andrea Corallo
9d4fd669cf * lisp/emacs-lisp/comp.el (comp-final): Log when interactively invoked. 2020-09-23 20:48:23 +02:00
Andrea Corallo
63c65b4fe0 * lisp/emacs-lisp/comp.el (native-compile): Add OUTPUT parameter. 2020-09-23 20:47:34 +02:00
Mattias Engdegård
3bfddaec3a ; * lisp/emacs-lisp/lisp.el: rename parameter in last change 2020-09-23 18:08:32 +02:00
Mattias Engdegård
df0f32f048 Don't signal scan-error when moving by sexp interactively
* lisp/emacs-lisp/lisp.el (forward-sexp, backward-sexp, forward-list)
(backward-list, down-list, up-list, mark-sexp, kill-sexp)
(backward-kill-sexp): Remove unsightly scan-error when running
interactively and no further movement by sexp can be made (bug#43489).
2020-09-23 16:31:18 +02:00
martin rudalics
10696d0ac5 Make delete-pair only delete pairs that are part of insert-pair-alist
* lisp/emacs-lisp/lisp.el (delete-pair): Only delete pairs that
are part of `insert-pair-alist' (bug#4136).
2020-09-22 16:44:15 +02:00
Lars Ingebrigtsen
73f77558cc Fix off-by-one error in eldoc--handle-docs
* lisp/emacs-lisp/eldoc.el (eldoc--handle-docs): We have one extra
line to use if we don't show the truncation message (bug#43543).
2020-09-22 16:20:05 +02:00
Andrea Corallo
89a2e79b7d * Make use of use of subr-primitive-p' in find-function-library'
* lisp/emacs-lisp/find-func.el (find-function-library): Use
	`subr-primitive-p'.
2020-09-21 21:46:18 +02:00
Andrea Corallo
69c32e0187 * Sandbox syncronous libgccjit invocation on interactive sessions
Avoid unnecessary memory fragmentation/leakeage

	* lisp/emacs-lisp/comp.el (comp-final1): New function.
	(comp-final): Invoke `comp-final1' in a child process if in an
	interactive session or directly otherwhise.
2020-09-21 21:46:07 +02:00
Andrea Corallo
5a8be1719a Merge remote-tracking branch 'savannah/master' into HEAD 2020-09-21 21:45:02 +02:00
Stefan Kangas
462dbc1cb2 ; Fix typos 2020-09-21 14:26:42 +02:00
Lars Ingebrigtsen
e72d3793bc Allow disabling the verbose eldoc truncation message
* doc/emacs/programs.texi (Lisp Doc): Document it.

* lisp/emacs-lisp/eldoc.el (eldoc-display-truncation-message): New
variable (bug#43543).
(eldoc--handle-docs): Use it.
2020-09-21 14:15:39 +02:00
Glenn Morris
81aed7becf ; * lisp/emacs-lisp/syntax.el (syntax-propertize-function): Doc fix. 2020-09-20 17:20:08 -07:00
Glenn Morris
3675993d76 Merge from origin/emacs-27
df04f3e755 Fix a rare segfault in syntax.c
fd1fe1e1ec Add doc to syntax-propertize-function saying it must do a ...
fcd599bbea Minor copyedits of doc of 'with-silent-modifications'
759399cdb1 Improve documentation of 'max-mini-window-height'
3223302aa2 Use modern constant names for the NS pasteboard
985703d380 Fix doc string of 'toggle-menu-bar-mode-from-frame'
184a4977c7 Make vc-bzr tests work with brz 3.1 (bug#43314)

# Conflicts:
#	lisp/emacs-lisp/syntax.el
#	src/syntax.c
2020-09-20 17:18:16 -07:00
Alan Mackenzie
fd1fe1e1ec Add doc to syntax-propertize-function saying it must do a 100% job
and cannot be combined with other ways of applying syntax-table text
properties.

* lisp/emacs-lisp/syntax.el (syntax-propertize-function): Amend doc string.

* doc/lispref/syntax.texi (Syntax Properties): Amend the description of the
variable.
2020-09-19 16:50:27 +00:00
Drew Adams
28ba879362 Document and extend menu-bar-make-toggle some
2020-09-19  Lars Ingebrigtsen  <larsi@gnus.org>

	* lisp/menu-bar.el (menu-bar-showhide-fringe-menu): Adjust caller.
	(menu-bar-search-options-menu): Ditto.
	(menu-bar-options-menu): Ditto.
	(menu-bar-options-menu): Ditto.

	* lisp/progmodes/gdb-mi.el (menu): Ditto.

	* lisp/emacs-lisp/find-func.el (find-function-regexp): Add
	menu-bar-make-toggle-command.

	* lisp/menu-bar.el (menu-bar-make-toggle): Compatibility wrapper.

2020-09-19  Drew Adams  <drew.adams@oracle.com>

	* lisp/menu-bar.el (menu-bar-make-toggle-command): Add doc string
	and allow setting all keywords (bug#17954).
2020-09-19 18:23:27 +02:00
Lars Ingebrigtsen
144bbfc662 Allow customizing hooks defined via define-minor-mode
* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Allow using
Customize on the hooks (bug#10773).
2020-09-19 17:21:02 +02:00
Andrii Kolomoiets
a1d9463ae7 Save and restore point in ewoc-invalidate
* lisp/emacs-lisp/ewoc.el (ewoc--refresh-node): Save and restore point line
and column offset.
(eowc-map) (ewoc--invalidate) (ewoc-set-hf): Don't use save-excursion
* lisp/vc/vc-dir.el (vc-dir-update): Don't save/restore point on calling
'ewoc-invalidate'.
2020-09-18 11:53:32 -04:00
Lars Ingebrigtsen
8a028e900d Revert "Make delete-pair only delete pairs that are part of insert-pair-alist"
This reverts commit 82de8ecc08.

This patch breaks doing `M-x delete-pair' on "foo" in text-mode.
2020-09-18 01:11:40 +02:00
Lars Ingebrigtsen
5e031c5e70 Fix up previous autoload-find-generated-file change
* lisp/emacs-lisp/autoload.el (autoload-find-generated-file): Use
the correct name for find-file-hook.
2020-09-17 18:09:01 +02:00
Lars Ingebrigtsen
64ba14f366 Make package install not bug out on weird stuff in find-file-hooks
* lisp/emacs-lisp/autoload.el (autoload-find-generated-file):
Users may have read-only-mode in find-file-hooks (bug#43460) so
just disable all the hooks here.
2020-09-17 18:02:44 +02:00
martin rudalics
82de8ecc08 Make delete-pair only delete pairs that are part of insert-pair-alist
* lisp/emacs-lisp/lisp.el (delete-pair): Only delete pairs that
are part of `insert-pair-alist' (bug#4136).
2020-09-17 16:43:45 +02:00
Andrea Corallo
e972837576 * Fix free function compilation load process.
* lisp/emacs-lisp/comp.el (comp-clean-up-stale-eln): Do not crash
	if the eln filename is not canonical (tmp file or manual load).
2020-09-14 23:06:42 +02:00
Andrea Corallo
82171a8f0d * Add gv-setters for compiler hints
* lisp/emacs-lisp/comp.el (comp-hint-fixnum, comp-hint-cons): Add
	gv-setters so type hinted expressions can be used as places.
	Read we can now have like: '(cl-incf (cl-the fixnum x))'.
2020-09-14 23:06:42 +02:00
Andrea Corallo
2da2ad29b8 * lisp/emacs-lisp/comp.el (comp-sp): Better style gv-setter declaration. 2020-09-14 23:06:42 +02:00
Andrea Corallo
a3dc11e9cc * Remove type check emission from type hints low level primitives
These have to be emitted by higher level primitves as `cl-the'.

	* lisp/emacs-lisp/comp.el (comp-hint-fixnum, comp-hint-cons): Do
	not emit type checks.
2020-09-14 23:06:42 +02:00
Andrea Corallo
c9a9b0766f * lisp/emacs-lisp/cl-macs.el: Define fixnum and bignum.
Define fixnum so `cl-typep' recognize it and the type check emitted by
`cl-the' is effective.
2020-09-14 23:06:42 +02:00
Andrea Corallo
95312717c7 * Add 'cl-optimize' as function declaration
* lisp/emacs-lisp/cl-macs.el: Register cl-optimize into
	`defun-declarations-alist' and `macro-declarations-alist'.
	(cl--optimize): New function to serve 'cl-optimize' declaration.
2020-09-14 23:06:42 +02:00
Andrea Corallo
c4cc13917c * lisp/emacs-lisp/cl-macs.el (cl-the): Emit compiler hints when native. 2020-09-14 23:06:42 +02:00
Stefan Monnier
e408f2fab2 * test/lisp/emacs-lisp/find-func-tests.el: New file (for bug#43393)
* lisp/emacs-lisp/ert-x.el (ert-simulate-keys): New macro.

* test/lisp/international/mule-tests.el
(mule-cmds--test-universal-coding-system-argument): Use it and enable
the test also in batch mode.
2020-09-14 16:04:22 -04:00
Lars Ingebrigtsen
7629aa7409 Revert "Fix completion in `read-library-name'"
This reverts commit ed44217d32.

This commit broke the use case of `M-x load-library RET o/or TAB' to
expand to org/org.
2020-09-14 13:26:17 +02:00
Andrea Corallo
21021e56ad * Fix defsbust declare effectiveness introduced by 80d7f710 (Bug#43280).
* lisp/emacs-lisp/byte-run.el (defsubst): Do not add a speed
	declaration as this breaks a pre existing ones if present but
	rather calls directly `byte-run--set-speed'.
2020-09-13 18:53:30 +02:00
Andrea Corallo
6a726c5ad7 Merge remote-tracking branch 'savannah/master' into HEAD 2020-09-13 18:20:21 +02:00
Lars Ingebrigtsen
97e9bddd0f Fix compilation warning in cl-lib.el
* lisp/emacs-lisp/cl-lib.el (cl-old-struct-compat-mode): Put the
minor mode in the tools group (to avoid a compilation warning).
2020-09-12 15:06:58 +02:00
Andrea Corallo
3c58403b0f By default when building native compile only what's part of the dump image
To Ahead of Time compile the whole Emacs distro define NATIVE_FULL_AOT
when invoking make ex: 'make NATIVE_FULL_AOT=1'.

	* lisp/Makefile.in (NATIVE_SKIP_NONDUMP): New variable.
	(compile-main): Use it + rename NATIVE_DISABLE -> NATIVE_DISABLED.
	* lisp/emacs-lisp/comp.el
	(batch-byte-native-compile-for-bootstrap): Rename NATIVE_DISABLE
	-> NATIVE_DISABLED.
2020-09-11 11:01:11 +02:00
Andrea Corallo
a26b14733b Merge remote-tracking branch 'savannah/master' into HEAD 2020-09-10 10:45:02 +02:00
Naoya Yamashita
66509f2ead Add gv-define-expander for plist-get
It is necessary to make plist-get as a generalized variable, and this
definition allows user to use setf and other useful functions on
plist-get.

* lisp/emacs-lisp/gv.el: Add gv-define-expander for plist-get

* lisp/emacs-lisp/gv-tests.el: Add new tests for plist-get
2020-09-09 13:50:05 -04:00
Stefan Monnier
6e7736ac5f (define-minor-mode): Don't compute a default :group (bug#41145)
* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Rely on the
`defcustom`s own defaulting for the :group.

* lisp/display-fill-column-indicator.el
(global-display-fill-column-indicator-mode): Remove now redundant :group.

* lisp/cus-dep.el (custom--get-def): New function.
(custom-make-dependencies): Use it.
2020-09-09 13:30:20 -04:00