Commit graph

6888 commits

Author SHA1 Message Date
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
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
Andrea Corallo
dc4b50ce0b * Do not crash compilation if user eln-cache wasn't already created.
* lisp/emacs-lisp/comp.el (comp-clean-up-stale-eln): Guard
	against calling `directory-files' on non existent directories.
2020-09-07 23:18:36 +02:00
Lars Ingebrigtsen
660d13bd7b Use format-prompt in calls to completing-read with a default value
* lisp/textmodes/rst.el (rst-insert-list-new-item):
* lisp/tab-bar.el (tab-bar-switch-to-tab):
* lisp/profiler.el (profiler-start):
* lisp/frame.el (set-frame-font):
* lisp/erc/erc.el (erc-join-channel):
* lisp/emacs-lock.el (emacs-lock--set-mode):
* lisp/emacs-lisp/elp.el (elp-set-master):
* lisp/emacs-lisp/checkdoc.el ()
(checkdoc-this-string-valid-engine):
* lisp/calendar/todo-mode.el (todo-find-filtered-items-file):
* lisp/calendar/calendar.el (calendar-set-date-style): Use
`format-prompt' in calls to completing-read that has a default
value, but didn't mention that in the prompt.
2020-09-06 20:35:11 +02:00
Lars Ingebrigtsen
b2f41a8a18 Disable display-warning buttons when doing batch compiles
* lisp/emacs-lisp/warnings.el (display-warning): Don't output the
buttons when we're not interactive (bug#43244).
2020-09-06 18:34:18 +02:00
Andrea Corallo
a71f54eff8 Rework eln deletion strategy for new eln-cache folder structure
When recompiling remove the corresponding stale elns found in the
`comp-eln-load-path'.

When removing a package remove the corresponding elns too.

On Windows both of these are performed only when possible, when it's
not the file is renamed as .eln.old and a last attempt to remove this
is performed closing the Emacs session.  When a file being deleted was
loaded by multiple Emacs sessions the last one being closed should
delete it.

	* lisp/emacs-lisp/comp.el (comp-clean-up-stale-eln): New function.
	(comp-delete-or-replace-file): Rename from
	`comp--replace-output-file' and update so it can be used for
	replacing or deleting shared libs safetly.

	* lisp/emacs-lisp/package.el (package--delete-directory): When
	native compiled just call `comp-clean-up-stale-eln' for each
	eln file we want to clean-up.

	* src/alloc.c (cleanup_vector): Call directly the dynlib_close.

	* src/comp.c (syms_of_comp): Update for comp_u->cfile removal.
	Make 'all_loaded_comp_units_h' key-value weak as now the key will
	be the filename.
	(load_comp_unit): Register the compilation unit only when the load
	is fully completed.
	(register_native_comp_unit): Make the key of
	all_loaded_comp_units_h the load filename.
	(eln_load_path_final_clean_up): New function.
	(dispose_comp_unit)
	(finish_delayed_disposal_of_comp_units)
	(dispose_all_remaining_comp_units)
	(clean_package_user_dir_of_old_comp_units): Remove.
	(Fcomp__compile_ctxt_to_file): Update for
	`comp--replace-output-file' -> `comp-delete-or-replace-file'
	rename.

	* src/comp.h (dispose_comp_unit)
	(finish_delayed_disposal_of_comp_units)
	(dispose_all_remaining_comp_units)
	(clean_package_user_dir_of_old_comp_units): Remove.
	(eln_load_path_final_clean_up): Add.
	(struct Lisp_Native_Comp_Unit): Remove cfile field.

	* src/emacs.c (Fkill_emacs): Call 'eln_load_path_final_clean_up'.

	* src/pdumper.c (dump_do_dump_relocation): Do not set comp_u->cfile.
2020-09-06 18:17:00 +02:00
Lars Ingebrigtsen
7d927fa8dd Use `format-prompt' when prompting with default values
* lisp/woman.el (woman-file-name):
* lisp/wid-edit.el (widget-file-prompt-value)
(widget-coding-system-prompt-value):
* lisp/w32-fns.el (w32-set-system-coding-system):
* lisp/vc/vc.el (vc-print-root-log):
* lisp/vc/vc-annotate.el (vc-annotate):
* lisp/vc/emerge.el (emerge-read-file-name):
* lisp/vc/ediff.el (ediff-directories)
(ediff-directory-revisions, ediff-directories3)
(ediff-merge-directories, )
(ediff-merge-directories-with-ancestor)
(ediff-merge-directory-revisions)
(ediff-merge-directory-revisions-with-ancestor)
(ediff-merge-revisions, ediff-merge-revisions-with-ancestor)
(ediff-revision):
* lisp/vc/ediff-util.el (ediff-toggle-regexp-match):
* lisp/vc/ediff-mult.el (ediff-filegroup-action):
* lisp/vc/add-log.el (prompt-for-change-log-name):
* lisp/textmodes/table.el (table-insert-row-column)
(table-span-cell, table-split-cell-horizontally)
(table-split-cell, table-justify, table-generate-source)
(table-insert-sequence, table-capture)
(table--read-from-minibuffer, table--query-justification):
* lisp/textmodes/sgml-mode.el (sgml-tag, sgml-tag-help):
* lisp/textmodes/reftex-ref.el (reftex-goto-label):
* lisp/textmodes/refer.el (refer-get-bib-files):
* lisp/textmodes/css-mode.el (css-lookup-symbol):
* lisp/term.el (serial-read-name, serial-read-speed):
* lisp/speedbar.el (speedbar-change-initial-expansion-list):
* lisp/simple.el (previous-matching-history-element)
(set-variable):
* lisp/ses.el (ses-read-cell, ses-set-column-width):
* lisp/replace.el (query-replace-read-from)
(occur-read-primary-args):
* lisp/rect.el (string-rectangle, string-insert-rectangle):
* lisp/progmodes/tcl.el (tcl-help-on-word):
* lisp/progmodes/sh-script.el (sh-set-shell):
* lisp/progmodes/python.el (python-eldoc-at-point):
* lisp/progmodes/octave.el (octave-completing-read)
(octave-update-function-file-comment, octave-insert-defun):
* lisp/progmodes/inf-lisp.el (lisp-symprompt):
* lisp/progmodes/cperl-mode.el (cperl-info-on-command)
(cperl-perldoc):
* lisp/progmodes/compile.el (compilation-find-file):
* lisp/net/rcirc.el (rcirc-prompt-for-encryption):
* lisp/net/eww.el (eww):
* lisp/net/browse-url.el (browse-url-with-browser-kind):
* lisp/man.el (man):
* lisp/mail/sendmail.el (sendmail-query-user-about-smtp):
* lisp/mail/mailalias.el (build-mail-aliases):
* lisp/mail/mailabbrev.el (merge-mail-abbrevs)
(rebuild-mail-abbrevs):
* lisp/locate.el (locate-prompt-for-search-string):
* lisp/isearch.el (isearch-occur):
* lisp/international/ogonek.el (ogonek-read-encoding)
(ogonek-read-prefix):
* lisp/international/mule.el (read-buffer-file-coding-system)
(set-terminal-coding-system, set-keyboard-coding-system)
(set-next-selection-coding-system, recode-region):
* lisp/international/mule-cmds.el ()
(universal-coding-system-argument, search-unencodable-char)
(select-safe-coding-system-interactively):
* lisp/info.el (Info-search, Info-search-backward, Info-menu):
* lisp/info-look.el (info-lookup-interactive-arguments):
* lisp/imenu.el (imenu--completion-buffer):
* lisp/ibuf-ext.el (mode, used-mode, ibuffer-mark-by-mode):
* lisp/hi-lock.el (hi-lock-unface-buffer)
(hi-lock-read-face-name):
* lisp/help.el (view-emacs-news, where-is):
* lisp/help-fns.el (describe-variable, describe-symbol)
(describe-keymap):
* lisp/gnus/mm-decode.el (mm-save-part):
* lisp/gnus/gnus-sum.el (gnus-summary-browse-url):
* lisp/gnus/gnus-group.el (gnus-group--read-bug-ids)
(gnus-group-set-current-level):
* lisp/frame.el (make-frame-on-monitor)
(close-display-connection, select-frame-by-name):
* lisp/format.el (format-encode-buffer, format-encode-region):
* lisp/files.el (recode-file-name):
* lisp/files-x.el (read-file-local-variable)
(read-file-local-variable-value, )
(read-file-local-variable-mode):
* lisp/ffap.el (ffap-menu-ask):
* lisp/faces.el (face-read-string):
* lisp/facemenu.el (facemenu-set-charset):
* lisp/erc/erc-dcc.el (erc-dcc-do-GET-command):
* lisp/emulation/edt-mapper.el (edt-mapper):
* lisp/emacs-lisp/trace.el (trace--read-args)
(trace-function-foreground, trace-function-background):
* lisp/emacs-lisp/smie.el (smie-config-set-indent):
* lisp/emacs-lisp/re-builder.el (reb-change-syntax):
* lisp/emacs-lisp/package.el (describe-package):
* lisp/emacs-lisp/find-func.el (read-library-name)
(find-function-read):
* lisp/emacs-lisp/ert.el (ert-read-test-name)
(ert-run-tests-interactively):
* lisp/emacs-lisp/disass.el (disassemble):
* lisp/emacs-lisp/debug.el (debug-on-entry)
(debug-on-variable-change):
* lisp/emacs-lisp/advice.el (ad-read-advised-function)
(ad-read-advice-class, ad-read-advice-name, ad-read-regexp):
* lisp/dired-x.el (dired--mark-suffix-interactive-spec):
* lisp/dired-aux.el (dired-diff):
* lisp/cus-edit.el (custom-variable-prompt, customize-mode)
(customize-changed-options):
* lisp/completion.el (interactive-completion-string-reader):
* lisp/calendar/timeclock.el (timeclock-ask-for-project):
* lisp/calc/calcalg3.el (calc-get-fit-variables):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-bin.el (calc-word-size):
* lisp/bookmark.el (bookmark-set-internal):
* lisp/abbrev.el (read-abbrev-file): Use `format-prompt' for
prompting (bug#12443).
2020-09-06 16:56:54 +02:00
Andrea Corallo
8055633466 Merge remote-tracking branch 'savannah/master' into HEAD 2020-09-06 08:07:30 +02:00
Robert Pluim
66d01012ba Show log suppression buttons in display-warning buffer
* etc/NEWS: Describe 'display-warning' button change (bug#30757).
* lisp/emacs-lisp/warnings.el (warning-suppress-warning):
Define button.
(warning-suppress-action): New function.
(warning-suppress-log-warning): Define button.
(warning-suppress-log-action): New function.
(display-warning): Show buttons to allow permanent
modification of warning-suppress-types and
warning-suppress-log-types per warning.
2020-09-04 06:28:21 +02:00
João Távora
ae6daa680a Fix ElDoc's eldoc-documentation-enthusiast strategy
As soon as we get a response from any of the user functions/sources in
eldoc-documentation-functions, we must make sure to call the
display-doc local function, just like in the other strategies.

That is even if that response produced nil, meaning that there's no
doc coming from that source.  Failure to do so when none of the
sources produced non-nil would keep stale documentation displaying.

First reported in https://github.com/joaotavora/eglot/issues/503

* lisp/emacs-lisp/eldoc.el (eldoc--invoke-strategy): Fix
:enthusiast strategy.
(Version): Bump to 1.10.0
2020-09-03 23:20:55 +01:00
Andrea Corallo
bce9cad421 * Store raw documentation during native compilation (bug#42974)
* lisp/emacs-lisp/comp.el (comp-spill-lap-function)
	(comp-intern-func-in-ctxt): Use raw documentation.
2020-08-30 10:23:49 +02:00
Stefan Kangas
826192409a Convert unsafep tests to ert
* lisp/emacs-lisp/tcover-unsafep.el: Move from here...
* test/lisp/emacs-lisp/unsafep-tests.el: ...to here, and convert to
use ert instead of tcover.
2020-08-29 23:35:00 +02:00
João Távora
c7e297e906 Prevent ElDoc blinking when eldoc-documentation-enthusiast is used
This eldoc-documentation-strategy function didn't always obey protocol
since it returned nil sometimes, which the eldoc engine took it as a
hint for the "old" protocol to clear the echo area.

* lisp/emacs-lisp/eldoc.el (eldoc-documentation-enthusiast):
Return t.
(Version): Bump to 1.9.0
2020-08-29 14:29:22 +01:00
Andrea Corallo
c3514a6274 Merge remote-tracking branch 'savannah/master' into HEAD 2020-08-29 11:33:37 +02:00
Stefan Kangas
a811a618e0 ; Bump seq version to 2.22 2020-08-29 00:42:36 +02:00
Stefan Kangas
d2412492ca Make XEmacs compat aliases obsolete in warnings.el
* lisp/emacs-lisp/warnings.el (display-warning-minimum-level)
(log-warning-minimum-level): Make XEmacs compat aliases into obsolete
aliases for 'warning-minimum-level' and 'warning-minimum-log-level'.
2020-08-28 17:33:44 +02:00
Stefan Kangas
766cd0c7c3 Use lexical-binding in warnings.el and add tests
* lisp/warnings.el: Use lexical-binding.
Remove redundant :group args.

* test/lisp/warnings-tests.el: New file.
2020-08-28 17:33:44 +02:00
Eric Abrahamsen
7974422dfc New eieio-persistent-make-instance generic function
This allows override of the read process for eieio-persistent objects,
providing the possibility of matching read/write customization for
eieio-persistent subclasses.

* lisp/emacs-lisp/eieio-base.el (eieio-persistent-make-instance): New
generic function for constructing instances from object data written
to disk. Previously known as eieio-persistent-convert-list-to-object.
2020-08-28 08:20:28 -07:00
Eric Abrahamsen
4d741e577f Remove redundant slot validation in eieio-persistent-read
Actual object creation (in `make-instance') will later run all slot
values through cl-typep, which does a better job of validation. This
validation is redundant, and slows the read process down.

* lisp/emacs-lisp/eieio-base.el (eieio-persistent-fix-value): Rename
from `eieio-persistent-validate/fix-slot-value', as we no longer
validate, and we don't care about the slot definition.
(eieio-persistent-slot-type-is-class-p): Delete function.
(eieio-persistent-convert-list-to-object): Still call
`eieio--full-class-object', to trigger an autoload if necessary, but
discard the return value.
2020-08-28 08:20:28 -07:00