Commit graph

6642 commits

Author SHA1 Message Date
Andrea Corallo
cf105f6044 * Fix bug#41112
* lisp/emacs-lisp/comp.el (comp-jump-table-optimizable): New
	function.
	(comp-emit-switch): Make use of 'comp-jump-table-optimizable'.
2020-05-07 10:23:10 +01:00
Andrea Corallo
f8df3320b1 * Add native compilation unit black list
* lisp/emacs-lisp/comp.el (comp-bootstrap-black-list): New customize.
	(batch-native-compile): Rework to make use of
	'comp-bootstrap-black-list'.
	(batch-byte-native-compile-for-bootstrap): Add assertion to make
	logic assumption explicit.
2020-05-06 20:11:47 +01:00
Andrea Corallo
c6a610ecdc Merge remote-tracking branch 'savannah/master' into HEAD 2020-05-04 18:24:00 +01:00
Stefan Monnier
40149b8718 * lisp/emacs-lisp/eieio.el (oset, oset-default): Mark as obsolete 2020-05-03 18:05:16 -04:00
Simen Heggestøyl
7db0093bc2 Use lexical-binding in check-declare.el and add tests
* lisp/emacs-lisp/check-declare.el: Use lexical-binding.
(check-declare-warn): Silence byte compiler warning about unused
lexical argument.

* test/lisp/emacs-lisp/check-declare-tests.el: New file with tests
for check-declare.el.
2020-05-03 19:50:57 +02:00
Stefan Kangas
5f516dc944 Remove redundant :groups args missed in last commit
* lisp/emacs-lisp/cl-indent.el (lisp-lambda-list-keyword-alignment)
(lisp-lambda-list-keyword-parameter-indentation)
(lisp-lambda-list-keyword-parameter-alignment)
(lisp-indent-backquote-substitution-mode): Remove redundant :group args.
2020-05-03 16:21:51 +02:00
Stefan Kangas
d55b3b5966 Improve indentation of 'loop' forms
* lisp/emacs-lisp/cl-indent.el (lisp-loop-keyword-indentation)
(lisp-loop-forms-indentation, lisp-simple-loop-indentation): Use a
more standard indentation of 'loop' forms.  (Bug#2160)

(lisp-indent-maximum-backtracking, lisp-tag-indentation)
(lisp-tag-body-indentation, lisp-backquote-indentation)
(lisp-loop-keyword-indentation, lisp-loop-forms-indentation)
(lisp-simple-loop-indentation): Remove redundant :group args.
2020-05-03 16:19:09 +02:00
Andrea Corallo
1ec7499e59 * Add a warning for missing write privilege
* lisp/emacs-lisp/comp.el (native-compile-async): Check for write
	privilege and raise a warning in case.
2020-05-03 13:37:38 +01:00
Andrea Corallo
8d37220190 * Introduce `comp-output-directory'
* lisp/emacs-lisp/comp.el (comp-output-directory): New function.
	(comp-output-base-filename): Use `comp-output-directory'.
2020-05-03 14:35:50 +01:00
Michael Heerdegen
c59e878439 Inhibit modification hooks when saving eieio-persistent's
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-save): Bind
inhibit-modification-hooks -> t.
2020-05-01 21:16:30 +02:00
João Távora
43fded12d5 Add lisp-data-mode for editing non-code Lisp data
Fixes: bug#40573

The new mode can be used stand-alone or inherited from by modes
intended to edit programs. The existing emacs-lisp-mode and lisp-mode
are examples.

Thanks to Juri Linkov and Basil L. Contovounesios for researching some
data files in Emacs that can be automatically set to use the new mode.

* lisp/files.el (auto-mode-alist): Add entry for ".dir-locals" and
".dir-locals-2"

* lisp/emacs-lisp/lisp-mode.el: (lisp-data-mode): New major mode.
(lisp-mode): Inherit from lisp-data-mode.  Set special lisp-mode
stuff here.

* lisp/progmodes/elisp-mode.el (emacs-lisp-mode): Inherit from
lisp-data-mode.

* lisp/bookmark.el (bookmark-insert-file-format-version-stamp):
Use lisp-data-mode.

* lisp/saveplace.el (save-place-alist-to-file): Use
lisp-data-mode.

* lisp/net/eww.el (eww-write-bookmarks): Use lisp-data-mode.

* lisp/net/nsm.el (nsm-write-settings): Use lisp-data-mode.

* lisp/net/tramp-cache.el (tramp-dump-connection-properties): Use
lisp-data-mode.

* etc/NEWS: Mention lisp-data-mode.

* doc/lispref/modes.texi (Example Major Modes): Update example.
2020-05-01 12:11:10 +01:00
Michael Heerdegen
0c899eede3 Make `make-local-variable' declare the var locally dynamic
The only effect of this change is to get rid of some unnecessary
"assignment to free variable" warnings.

* lisp/emacs-lisp/bytecomp.el (byte-compile-make-local-variable): New
function.
2020-04-30 20:50:33 +02:00
Andrea Corallo
02e3ffad6d * Fix async compilation non respecting `comp-always-compile' nil value.
* lisp/emacs-lisp/comp.el (comp-run-async-workers): Fix missing
	`comp-output-filename' usage.
2020-04-29 21:25:02 +01:00
Andrea Corallo
ab66e61b58 Merge remote-tracking branch 'savannah/master' into HEAD 2020-04-29 20:25:23 +01:00
Stefan Kangas
702d9d86f2 Add new tests to bindat-tests.el
* test/lisp/emacs-lisp/bindat-tests.el (bindat-test-format-vector)
(bindat-test-vector-to-dec, bindat-test-vector-to-hex)
(bindat-test-ip-to-string): New tests.
* lisp/emacs-lisp/bindat.el (bindat-vector-to-hex): Fix typo.
2020-04-29 09:52:34 +02:00
Stefan Kangas
c8115e88f1 Use lexical-binding in float-sup.el and add tests
* lisp/emacs-lisp/float-sup.el: Use lexical-binding.
* test/lisp/emacs-lisp/float-sup-tests.el: New file.
2020-04-29 09:25:02 +02:00
Andrea Corallo
f8b254d195 Rework spill LAP mechanism in preparation of compiling lambdas.
* lisp/emacs-lisp/comp.el (comp-spill-lap-function): No need anymore
	to have `byte-native-compiling' bound to free-func.
	(comp-spill-lap-function): Make use of `byte-to-native-lap-h' and
	clean-up.
	(comp-spill-lap-function): Likewise.

	* lisp/emacs-lisp/bytecomp.el (byte-to-native-function): Add lap slot.
	(byte-to-native-lap): Rename into byte-to-native-lap-h.
	(byte-compile-lapcode): Spill lap after having int assembled and
	store it into `byte-to-native-lap-h'.
	(byte-compile-not-top-level): Remove.
	(byte-compile-file-form-defmumble): Fill directly lap slot.
	(byte-compile-lambda): Remove `byte-compile-not-top-level'.
	(byte-compile-out-toplevel): Restore original code.
	(byte-compile-form): Remove `byte-compile-not-top-level'.
	(byte-compile-function-form): Likewise.
	(byte-compile-flush-pending): No need anymore to set
	`byte-compile-current-form' so restore orignal code.
2020-04-26 22:17:37 +01:00
Andrea Corallo
bb4cf13c47 Convert before final function doc hash into a vector.
* lisp/emacs-lisp/comp.el (comp-finalize-relocs): Convert doc hash
	table into vector befor final.
	(comp-emit-for-top-level): Rename `comp-ctxt-doc-index-h' ->
	`comp-ctxt-function-docs'.
	(comp-ctxt): Likewise.

	* src/comp.c (native_function_doc): Update logic for documentation
	being a vector.
	(emit_ctxt_code): Update for 'comp-ctxt-doc-index-h' slot rename.

	* src/comp.h (struct Lisp_Native_Comp_Unit): Rename 'data_fdoc_h'
	into data_fdoc_v.

	* src/pdumper.c (dump_native_comp_unit): Likewise.
2020-04-26 10:10:17 +01:00
Andrea Corallo
2878624980 Merge remote-tracking branch 'savannah/master' into HEAD 2020-04-25 22:22:16 +01:00
Andrea Corallo
d73e64076e Store function documentations in a hash table.
* src/pdumper.c (dump_subr): Update Lisp_Subr hash.
	(dump_subr): Update for new compilation unit layout.
	(dump_vectorlike): Update pvec_type hash.

	* src/lisp.h (struct Lisp_Subr): Remove 'native_doc' index.
	(DEFUN): Update macro for new compilation unit
	layout.

	* src/doc.c (Fdocumentation): Update for new compilation unit
	layout.

	* src/comp.h (struct Lisp_Native_Comp_Unit):
	Add 'data_fdoc_h' field.

	* src/comp.c (TEXT_FDOC_SYM): New macro.
	(emit_ctxt_code): Emit function documentations.
	(load_comp_unit): Load function documentation.
	(Fcomp__register_subr): Rename parameter.
	(Fcomp__register_subr): Update for new compilation unit
	layout.

	* src/alloc.c (mark_object): Update for new compilation unit
	layout.
	(syms_of_alloc): Likewise.

	* lisp/emacs-lisp/comp.el (comp-ctxt): Add doc-index-h slot.
	(comp-emit-for-top-level): Emit doc index as 'comp--register-subr'
	doc parameter.
2020-04-25 19:55:39 +01:00
Andrea Corallo
9c4c0af89d * lisp/emacs-lisp/comp.el (comp-run-async-workers): Use `clrhash'. 2020-04-25 19:55:40 +01:00
Glenn Morris
519567878f Merge from origin/emacs-27
45a64c97c7 (origin/emacs-27) Clarify semantics of trace-function CONT...
821760fdc4 Don't let a code literal get modified in mml parsing (Bug#...
74a92be16d * lisp/simple.el (kill-ring-save): Doc fix.  (Bug#40797)
3d0e859692 Minor doc clarification regarding fringe bitmaps
4d86c7f822 Fix documentation of fringe bitmaps
a76af88dd8 Tweak mutability doc a bit more
f7e488d206 Calc: fix autoload errors (bug#40800)
369761b36d ; * src/xdisp.c: Improve the introductory commentary.
a92ca1f177 Improve indexing of ELisp manual
5a25d17760 * lisp/image-mode.el (image-transform-resize): Remove FIXM...
37ebec3a95 Improve the default value of 'doc-view-ghostscript-program'.
ba6104d1e8 Change doc-view-mode-map prefix key 's' to 'c'.
400ff5cd19 Improve wording about constants
d2836fe71b Improve the default value of 'doc-view-ghostscript-program'.
fc55f65305 Minor improvements in documentation of the last change
a64da75961 Add image-auto-resize defcustoms to image-mode.el
692ad40539 Improve the documentation of tab-bar and tab-line

# Conflicts:
#	etc/NEWS
2020-04-25 07:50:21 -07:00
Andrea Corallo
c984a53b4e Merge remote-tracking branch 'savannah/master' into HEAD 2020-04-25 15:13:18 +01:00
Andrea Corallo
bab36619fb Fix deferred-compilation for double compilation (bug#40838).
* lisp/emacs-lisp/comp.el (native-compile-async): Prevent double
	compilation (bug#40838).
2020-04-25 15:12:37 +01:00
Andrea Corallo
e208de9d25 Store ongoing compilations processes as hash table.
* lisp/emacs-lisp/comp.el (comp-async-processes): Rename as
	`comp-async-compilations'.
	(comp-async-runnings): Make use as `comp-async-compilations'.
	(comp-run-async-workers): Likewise.
2020-04-25 15:12:37 +01:00
Noam Postavsky
45a64c97c7 Clarify semantics of trace-function CONTEXT argument
* lisp/emacs-lisp/trace.el (trace-function-foreground): Explain that
CONTEXT should be a function, when called from Lisp.
2020-04-25 09:55:37 -04:00
Alan Mackenzie
85fb942733 Fix bug #40766, an error in edebug spec handling
Also remove some debris.

* lisp/emacs-lisp/edebug.el (edebug-spec): Move the entry for edebug-spec-list
to before that for vector in the &or form.  This assures that in a dotted list
of vectors, that list gets handled correctly by edebug-spec-list rather than
wrongly by (vector ...).
(def-edebug-spec &key): Remove, since it is ill formed and superfluous.
2020-04-24 15:51:43 +00:00
Andrea Corallo
b380451c6a * lisp/emacs-lisp/comp.el (comp-run-async-workers): Fix non late load. 2020-04-24 19:02:55 +01:00
Andrea Corallo
81389d5f2d * lisp/emacs-lisp/bytecomp.el (byte-compile-refresh-preloaded): Add comp.eln 2020-04-23 08:54:46 +01:00
Andrea Corallo
301cf0d278 Merge remote-tracking branch 'savannah/master' into HEAD 2020-04-23 08:41:15 +01:00
Glenn Morris
477b9eaf45 Merge from origin/emacs-27
05089a4d65 (origin/emacs-27) Tweak wording re constant variables
a1040861f1 Tweak setcar-related wording
751510f865 * lisp/image-mode.el: Add prefix key 's' and reduce depend...
9261a219ec * doc/emacs/windows.texi (Window Convenience): Decribe mor...
e1d42da0d6 Fix mutability glitches reported by Drew Adams
5805df74f5 Improve mutability doc
dca35b31d0 Improve mutability documentation
81e7d7f111 Document that quoting yields constants
5734339f40 * doc/lispref/keymaps.texi (Extended Menu Items, Easy Menu...
14a570afae Remove #' and function quoting from lambda forms in manual
d5ec18c66b * src/regex-emacs.c (re_match_2_internal): Rework comment ...
4df8a61117 Add new node "Image Mode" to Emacs Manual.
d7d5ee6c57 ; Fix a typo in cmdargs.texi (bug#40701)
5e9db48fbe * doc/lispref/display.texi (Customizing Bitmaps): Fix typo.
eebfb72c90 Document constant vs mutable objects better
6c187ed6b0 Improve documentation of 'sort-lines'
52288f4b66 Mention 'spam-stat-process-directory-age' in the documenta...
067b070598 ; Fix some typos and doc issues (bug#40695)

# Conflicts:
#	etc/NEWS
2020-04-20 07:50:19 -07:00
Štěpán Němec
067b070598 ; Fix some typos and doc issues (bug#40695) 2020-04-18 17:10:02 +02:00
Andrea Corallo
65cc8efa33 * lisp/emacs-lisp/comp.el (comp-never-optimize-functions): Better doc fix 2020-04-16 19:06:08 +01:00
Andrea Corallo
d432cbeb27 Merge remote-tracking branch 'savannah/master' into HEAD 2020-04-16 17:35:35 +01:00
Andrea Corallo
886ded1b70 * lisp/emacs-lisp/comp.el (comp-never-optimize-functions): Add yes-or-no-p 2020-04-16 18:59:40 +01:00
Glenn Morris
97e48510ad Merge from origin/emacs-27
a5f7c26907 (origin/emacs-27) * admin/authors.el: Add an author alias.
d87a4d1f4e Limit RLIMIT_NOFILE to FD_SETSIZE on macOS
e5ca8e5e73 Fix Elisp manual entry on 'set-window-configuration'
485f24223f ; Update ChangeLog.3
8f200254fb ; Update etc/AUTHORS
c7adc851ad * admin/authors.el: Add missing author aliases.
4acdd7fe58 Fix edge case errors in filename-matching regexps
5f36e21fe5 Clarify the doc string of 'yank'
13301d4266 New function erc-track-switch-buffer-other-window
38f7538d8f New function erc-switch-to-buffer-other-window

# Conflicts:
#	etc/NEWS
2020-04-15 07:50:15 -07:00
Andrea Corallo
8db8c851ad Always set load-true-file-name' where load-file-name' is set too.
Fix bug#40620.

	* lisp/cus-dep.el (custom-make-dependencies): Set
	load-true-file-name.

	* lisp/emacs-lisp/package.el (package-quickstart-refresh):
	Likewise.

	* lisp/international/mule.el (load-with-code-conversion):
	Likewise.

	* lisp/loadup.el (load-true-file-name): Likewise.
2020-04-14 19:58:41 +01:00
Mattias Engdegård
4acdd7fe58 Fix edge case errors in filename-matching regexps
These changes fix actual or latent bugs in regexps that match
file names, such as PATTERN arguments to 'directory-files'.  See
https://lists.gnu.org/archive/html/emacs-devel/2020-04/msg00265.html

* admin/authors.el (authors-obsolete-files-regexps)
(authors-renamed-files-regexps):
* lisp/auth-source-pass.el (auth-source-pass-entries):
* lisp/calendar/todo-mode.el (todo-show, todo-find-filtered-items-file)
(todo-filter-items, todo-reset-nondiary-marker, todo-reset-done-string)
(todo-reset-comment-string, todo-reset-highlight-item):
* lisp/cedet/semantic/db-ebrowse.el (semanticdb-load-ebrowse-caches):
* lisp/cedet/semantic/texi.el (semantic-texi-associated-files):
* lisp/cedet/srecode/map.el (srecode-map-update-map):
* lisp/dired.el (dired-re-no-dot):
* lisp/emacs-lisp/autoload.el (update-directory-autoloads):
* lisp/emacs-lisp/shadow.el (load-path-shadows-find):
* lisp/files.el (auto-mode-alist, directory-files-no-dot-files-regexp):
* lisp/finder.el (finder-compile-keywords):
* lisp/generic-x.el (inetd-conf-generic-mode, named-boot-generic-mode)
(resolve-conf-generic-mode, etc-modules-conf-generic-mode):
* lisp/gnus/gnus-agent.el (gnus-agent-read-agentview)
(gnus-agent-regenerate-group, gnus-agent-update-files-total-fetched-for):
* lisp/gnus/gnus-cache.el (gnus-cache-articles-in-group):
* lisp/gnus/gnus-score.el (gnus-score-search-global-directories):
* lisp/gnus/gnus-util.el (gnus-delete-directory):
* lisp/gnus/gnus-uu.el (gnus-uu-dir-files):
* lisp/gnus/nndraft.el (nndraft-request-group):
* lisp/gnus/nnmh.el (nnmh-request-group, nnmh-request-create-group):
(nnmh-request-delete-group, nnmh-active-number, nnmh-update-gnus-unreads):
* lisp/gnus/nnspool.el (nnspool-request-group):
* lisp/gnus/spam-stat.el (spam-stat-process-directory)
(spam-stat-test-directory):
* lisp/help-fns.el (help-fns--first-release):
* lisp/help.el (view-emacs-news):
* lisp/international/quail.el (quail-update-leim-list-file):
* lisp/international/titdic-cnv.el (batch-titdic-convert):
* lisp/mail/mspools.el (mspools-set-vm-spool-files)
(mspools-get-spool-files):
* lisp/mail/rmail.el (rmail-secondary-file-regexp)
(rmail-speedbar-match-folder-regexp):
* lisp/net/ange-ftp.el (ange-ftp-delete-directory):
* lisp/net/tramp.el (tramp-use-absolute-autoload-file-names):
* lisp/obsolete/gulp.el (gulp-send-requests):
* lisp/obsolete/vc-arch.el (vc-arch-trim-revlib):
* lisp/org/ob-core.el (org-babel-remove-temporary-directory):
* lisp/progmodes/ebnf2ps.el (ebnf-file-suffix-regexp, ebnf-style-database):
* lisp/progmodes/executable.el (executable-command-find-posix-p):
* lisp/startup.el (command-line):
* lisp/textmodes/refer.el (refer-get-bib-files):
* lisp/url/url-about.el (url-probe-protocols):
* lisp/vc/vc-rcs.el (vc-rcs-register, vc-rcs-unregister):
* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test19-directory-files-and-attributes):
* test/lisp/net/tramp-tests.el (tramp-test19-directory-files-and-attributes):
Replace ^ and $ with \` and \', respectively.
Use (rx (or (not ".") "...")), translated into "[^.]\\|\\.\\.\\.",
to match anything but "." and "..", instead of several incorrect
regexps.
2020-04-14 12:25:16 +02:00
Andrea Corallo
8decfbe4d7 * lisp/emacs-lisp/comp.el (native-compile-async): Better error message. 2020-04-14 08:48:24 +01:00
Andrea Corallo
b7678cf10e * lisp/emacs-lisp/comp.el (comp-finalize-relocs): Better commentary. 2020-04-13 20:44:09 +01:00
Andrea Corallo
9f42f35418 * Fix native-compile-async for bug#40602.
* lisp/emacs-lisp/comp.el (native-compile-async): Relax coherency condition.
2020-04-13 20:44:09 +01:00
Andrea Corallo
517c123fd4 Merge remote-tracking branch 'savannah/master' into HEAD 2020-04-13 18:11:12 +01:00
Glenn Morris
0a4b992c42 Merge from origin/emacs-27
1dfc497fac Minor wording change in Introduction to Programming in Ema...
ff09b4eeac Fix 'flymake-show-diagnostics-buffer' when line numbers ar...
63e8d0ea87 Fix last changes describing mail commands
01212a762f Do setup Flymake in file-less Elisp buffers
36873ef2b2 Fix error message for ‘cl-struct-unknown-slot’ (bug#39995)
3f9310b0fe Fix and improve documentation of mail-related features
1482a75efa Fix build failure with Fx_gtk_debug
cf57663f2a Mention jit-lock deferred as an alternative to fast-but-im...

# Conflicts:
#	etc/NEWS
2020-04-13 09:02:29 -07:00
Štěpán Němec
188bd80a90 gnus-shorten-url: Improve and avoid args-out-of-range error
'gnus-shorten-url' (used by 'gnus-summary-browse-url') ignored
fragment identifiers and didn't check substring bounds, in some cases
leading to runtime errors, e.g.:

  (gnus-shorten-url "https://some.url.with/path/and#also_a_long_target" 40)
  ;; => Lisp error: (args-out-of-range "/path/and" -18 nil)

This commit makes it account for #fragments and fixes faulty string
computation, reusing existing helper function.  (bug#39980)

* lisp/vc/ediff-init.el (ediff-truncate-string-left): Rename to
'string-truncate-left' and move...
* lisp/emacs-lisp/subr-x.el (string-truncate-left):  ...here.
All callers changed.
* lisp/gnus/gnus-sum.el (gnus-shorten-url): Fix args-out-of-range
error, don't drop #fragments, use 'string-truncate-left'.
2020-04-13 12:12:00 +02:00
Andrea Corallo
f9a1d4b3f7 Merge remote-tracking branch 'savannah/master' into HEAD 2020-04-12 16:53:36 +01:00
Philipp Stephani
36873ef2b2 Fix error message for ‘cl-struct-unknown-slot’ (bug#39995)
* lisp/emacs-lisp/cl-macs.el (cl-struct-unknown-slot): Remove spurious
format specifiers.
2020-04-12 15:12:16 +02:00
Philipp Stephani
aed427ece5 Also use named functions for the ‘gv’ declare forms (Bug#40491)
* lisp/emacs-lisp/gv.el (gv--expander-defun-declaration)
(gv--setter-defun-declaration): New helper functions; use them.
2020-04-12 14:27:33 +02:00
Philipp Stephani
4f197a5e79 Use named functions in {defun,macro}-declarations-alist (Bug#40491)
* lisp/emacs-lisp/byte-run.el (byte-run--set-advertised-calling-convention)
(byte-run--set-obsolete, byte-run--set-interactive-only)
(byte-run--set-pure, byte-run--set-side-effect-free)
(byte-run--set-compiler-macro, byte-run--set-doc-string)
(byte-run--set-indent, byte-run--set-debug)
(byte-run--set-no-font-lock-keyword): New helper functions.
(defun-declarations-alist, macro-declarations-alist): Use them.
2020-04-12 13:18:43 +02:00
Andrea Corallo
4abb8c822c Merge remote-tracking branch 'savannah/master' into HEAD 2020-04-06 18:06:29 +01:00
Andrea Corallo
32a079aef2 * lisp/emacs-lisp/comp.el (comp-c-func-name): Fix for M-x disassemble 2020-04-06 20:03:34 +01:00