1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-15 07:41:09 -08:00
Commit graph

148415 commits

Author SHA1 Message Date
Eli Zaretskii
0f494760d3 ; * lisp/net/shr.el (shr-insert-document): Fix last change. 2021-04-11 09:35:09 +03:00
Stefan Monnier
d55d07af70 * lisp/net/shr.el (shr-insert-document): Explain why bidi-display-reordering 2021-04-10 20:06:35 -04:00
Gregory Heytings
5761e9004a Add new icomplete-vertical-mode
Co-authored-by: João Távora <joaotavora@gmail.com>

* lisp/icomplete.el (icomplete-completions): Consider icomplete-vertical-mode.
(icomplete-vertical-mode-minibuffer-map): New map.
(icomplete--vertical-minibuffer-setup): New helper.
(icomplete-vertical-mode): New minor mode.

* doc/emacs/buffers.texi (Icomplete): Mention icomplete-vertical-mode.

* etc/NEWS: Mention icomplete-vertical-mode
2021-04-10 23:51:05 +01:00
Stefan Monnier
ffd12743bd * lisp/misearch.el (multi-isearch-read-buffers): Fix last change
These are not buffers but buffer names.
2021-04-10 18:07:37 -04:00
Philipp Stephani
d6aa50f74c * src/emacs.c (read_full): Add a few assertions. 2021-04-10 23:41:52 +02:00
Stefan Monnier
56e8d969f5 * lisp/cus-dep.el: Use lexical-binding 2021-04-10 17:11:58 -04:00
Stefan Monnier
26e1d854d1 * lisp/misearch.el: Use lexical-binding
(multi-isearch-read-buffers, multi-isearch-read-files):
Replace `add-to-list` with `cl-pushnew` for use on a local variable.
2021-04-10 17:08:11 -04:00
Philipp Stephani
2db03e3e53 * src/emacs.c (load_seccomp): Add a useful assertion. 2021-04-10 23:04:04 +02:00
Philipp Stephani
496a46b32d * src/emacs.c (load_seccomp): Fix condition. 2021-04-10 23:04:04 +02:00
Stefan Monnier
8b92897633 * lisp/ps-bdf.el: Use lexical-binding 2021-04-10 17:03:11 -04:00
Stefan Monnier
edf8497ce3 * lisp/informat.el: Use lexical-binding 2021-04-10 17:01:01 -04:00
Stefan Monnier
5ad3893eba * lisp/loadup.el: Use lexical-binding 2021-04-10 16:58:11 -04:00
Stefan Monnier
cb6b810dfd * lisp/jka-compr.el: Use lexical-binding
Prefer #' to quote function names.
2021-04-10 16:25:28 -04:00
Philipp Stephani
1d474ad69d * etc/NEWS: Extend paragraph about &define form and backtracking 2021-04-10 21:54:12 +02:00
Glenn Morris
81ffc43383 ; Fix copyright years 2021-04-10 12:24:09 -07:00
Alan Mackenzie
3f5fe0cdfc Convert CC Mode to lexical binding in Emacs
lisp/progmodes/cc-align.el, lisp/progmodes/cc-awk.el,
lisp/progmodes/cc-bytecomp.el, lisp/progmodes/cc-cmds.el,
lisp/progmodes/cc-defs.el, lisp/progmodes/cc-engine.el,
lisp/progmodes/cc-fonts.el, lisp/progmodes/cc-guess.el,
lisp/progmodes/cc-langs.el, lisp/progmodes/cc-menus.el,
lisp/progmodes/cc-mode.el, lisp/progmodes/cc-styles.el,
lisp/progmodes/cc-subword.el, lisp/progmodes/cc-vars.el: Mark these files with
a `lexical-binding' setting in line 1.

lisp/progmodes/cc-align.el, lisp/progmodes/cc-engine.el,
lisp/progmodes/cc-vars.el (c-syntactic-context, c-syntactic-element): Declare
these as special variables.

lisp/progmodes/cc-bytecomp.el (cc-bytecomp-debug-msg): prefix the parameter
ARGS with a _, and remove an `ignore' call.

lisp/progmodes/cc-cmds.el (c-where-wrt-brace-construct): Remove `kluge-start',
an unused variable.
(c-while-widening-to-decl-block): Add an extra parameter, which suppresses
the generation of a setting of variable `where'.
(c-defun-name-and-limits): Remove variable `where' from the function and use
the new argument to the previous macro.

lisp/progmodes/cc-engine.el (c-cache-to-parse-ps-state): Remove two unneeded
variables, `last' and `intermediate'.

lisp/progmodes/cc-fonts.el (c-font-lock-c++-using): Remove unused variable.

lisp/progmodes/cc-langs.el (c-vsemi-status-unknown-p-fn): Replace the doc
string with the more precise one from stand-alone CC Mode.

lisp/progmodes/cc-styles.el (c-set-offset): Give the `ignored' parameter a
leading _.
2021-04-10 19:20:14 +00:00
Philipp Stephani
1060289f51 Add a helper binary to create a basic Secure Computing filter.
The binary uses the 'seccomp' helper library.  The library isn't
needed to load the generated Secure Computing filter.

* configure.ac: Check for 'seccomp' header and library.

* lib-src/seccomp-filter.c: New helper binary to generate a generic
Secure Computing filter for GNU/Linux.

* lib-src/Makefile.in (DONT_INSTALL): Add 'seccomp-filter' helper
binary if possible.
(all): Add Secure Computing filter file if possible.
(seccomp-filter$(EXEEXT)): Compile helper binary.
(seccomp-filter.bpf seccomp-filter.pfc): Generate filter files.

* test/src/emacs-tests.el (emacs-tests/seccomp/allows-stdout)
(emacs-tests/seccomp/forbids-subprocess): New unit tests.

* test/Makefile.in (src/emacs-tests.log): Add dependency on the helper
binary.
2021-04-10 21:10:16 +02:00
Philipp Stephani
2d17e0124e * src/emacs.c (load_seccomp): Fix condition. 2021-04-10 20:37:29 +02:00
Philipp Stephani
8a84f97abe Read file in a loop if necessary.
This allows for short reads from 'emacs_read'.

* src/emacs.c (read_full): New helper function.
(load_seccomp): Use it.
2021-04-10 20:37:29 +02:00
Eli Zaretskii
15122b3104 ; * etc/NEWS: Fix the wording of a recently added entry. 2021-04-10 21:17:09 +03:00
Philipp Stephani
be8328acf9 Add support for --seccomp command-line option.
When passing this option on GNU/Linux, Emacs installs a Secure
Computing kernel system call filter.  See Bug#45198.

* configure.ac: Check for seccomp header.

* src/emacs.c (usage_message): Document --seccomp option.
(emacs_seccomp): New wrapper for 'seccomp' syscall.
(load_seccomp, maybe_load_seccomp): New helper functions.
(main): Potentially load seccomp filters during startup.
(standard_args): Add --seccomp option.

* lisp/startup.el (command-line): Detect and ignore --seccomp option.

* test/src/emacs-tests.el (emacs-tests/seccomp/absent-file)
(emacs-tests/seccomp/empty-file)
(emacs-tests/seccomp/file-too-large)
(emacs-tests/seccomp/invalid-file-size): New unit tests.
(emacs-tests--with-temp-file): New helper macro.

* etc/NEWS: Document new --seccomp option.
2021-04-10 18:47:26 +02:00
Philipp Stephani
53dfd85a7f Edebug: Disable backtracking when hitting a &define keyword.
Edebug doesn't deal well with backtracking out of definitions, see
Bug#41988.  Rather than trying to support this rare situation (e.g. by
implementing a multipass parser), prevent it by adding an implicit
gate.

* lisp/emacs-lisp/edebug.el (edebug--match-&-spec-op): Disable
backtracking when hitting a &define keyword.

* test/lisp/emacs-lisp/edebug-tests.el
(edebug-tests-duplicate-&define): New unit test.
(edebug-tests--duplicate-&define): New helper macro.

* doc/lispref/edebug.texi (Backtracking): Mention &define in the list
of constructs that disable backtracking.

* etc/NEWS: Document new behavior.
2021-04-10 18:19:49 +02:00
Stefan Monnier
b72571ca49 * lisp/gnus/nnagent.el: Fix spurious empty line at BOB 2021-04-10 12:19:16 -04:00
Stefan Monnier
6b81f7c1dd * lisp/edmacro.el: Use lexical-binding
(edmacro-finish-edit, edmacro-parse-keys): Use `match-string`.
2021-04-10 12:18:22 -04:00
Stefan Monnier
3c051db646 * lisp/files-x.el: Use lexical-binding 2021-04-10 12:08:36 -04:00
Stefan Monnier
649e5c26ed * lisp/ps-mule.el: Use lexical-binding
(ps-mule-encode-header-string, ps-mule-begin-job): Use `pcase`.
2021-04-10 09:52:09 -04:00
Gregory Heytings
84c1940d42 Autoload list-colors-display.
* lisp/facemenu.el (list-colors-display): Autoload, it is mentioned
in (info "(emacs)Colors for Faces"), and to be generally available.
2021-04-10 16:13:11 +03:00
Michael Albinus
ca1ddef262 Tramp: fix location of files on W32
* lisp/net/tramp.el:
* lisp/net/tramp-sh.el: Use (eq system-type 'windows-nt) where appropriate.
(tramp-completion-function-alist-ssh): Fix location of files on W32.
2021-04-10 14:46:58 +02:00
Jim Porter
c975258abf Further fix of hostname completion on MS Windows
* lisp/net/tramp.el (tramp-completion-file-name-regexp-simplified)
(tramp-completion-file-name-regexp-separate): Fix W32 hostname/method
completion for simplified and separate syntaxes (same as the previous change
to default syntax).

Copyright-paperwork-exempt: yes
2021-04-10 13:16:13 +02:00
Eli Zaretskii
24d214652e Fix description of momentary message display
* doc/emacs/mini.texi (Basic Minibuffer): Update the description
of momentary message display while minibuffer is active.
(Bug#47689)
2021-04-10 13:41:48 +03:00
João Távora
c50b5907e0 Fail earlier if stale Flymake report functions called
If a Flymake backend calls a "stale" report function,
flymake--handle-report might be called for a backend function that is
no longer in the flymake--backend-state hash table.  This patch makes
that erroneous situation slightly more explicit.

* lisp/progmodes/flymake.el (flymake--handle-report): Improve
error reporting.
2021-04-10 11:19:34 +01:00
Dmitry Gutov
0db2126d71 Don't stop when before space or closing paren
* lisp/progmodes/elisp-mode.el (elisp-completion-at-point):
Don't stop when before space or closing paren (bug#47665).
2021-04-10 01:51:39 +03:00
Alan Mackenzie
f493a9bef4 CC Mode: fix c-where-wrt-brace-construct to cope with class declarations
Make the function correctly recognize a brace block preceded by an
introductory line without a parameter list.

* lisp/progmodes/cc-cmds.el (c-where-wrt-brace-contruct): Reintroduce the use
of c-beginning-of-decl-1, which was removed some weeks ago, in place of a
c-syntactic-skip-backward.  Reformulate the code generally.
2021-04-09 20:52:49 +00:00
Mattias Engdegård
59342f689e Fix condition-case optimiser bug
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Don't
perform incorrect optimisations when a condition-case variable shadows
another lexical variable.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
New test case.
2021-04-09 19:20:55 +02:00
Mattias Engdegård
b7a7e879d0 Better compiler warning tests
These changes allow all bytecomp-tests to be run interactively.

* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp--with-warning-test)
(bytecomp--define-warning-file-test): Interpret any space in the
pattern as arbitrary whitespace to tolerate line breaks.
Don't abuse the expected-failure mechanism when checking
for the expected absense of a warning.
(bytecomp/*.el): Rewrite patterns to work with line breaks
in the middle.
2021-04-09 19:20:55 +02:00
Mattias Engdegård
a2a7cfde29 Clean up bytecomp-tests.el
Now all test cases are run with both lexical and dynamic binding
where applicable, comparing interpreted against compiled results.
Previously, almost all tests were only run with dynamic binding
which was definitely not intended.

* test/lisp/emacs-lisp/bytecomp-tests.el
(byte-opt-testsuite-arith-data): Rename to bytecomp-tests--test-cases.
(bytecomp-check-1, bytecomp-explain-1, bytecomp-tests)
(bytecomp-lexbind-tests, bytecomp-lexbind-check-1)
(bytecomp-lexbind-explain-1): Remove.
(bytecomp-tests--eval-interpreted, bytecomp-tests--eval-compiled)
(bytecomp-tests-lexbind, bytecomp-tests-dynbind)
(bytecomp-tests--test-cases-lexbind-only): New.
2021-04-09 19:20:54 +02:00
Stefan Kangas
40db60563c Make refer-every into obsolete alias for seq-every-p
* lisp/textmodes/refer.el (refer-every): Make into obsolete
function alias for seq-every-p.  Update single caller.
2021-04-09 18:42:14 +02:00
Stefan Kangas
512ec97bcf Remove redundant #' before lambda in ibuf-*.el
* lisp/ibuf-ext.el (ibuffer-included-in-filters-p)
(ibuffer-included-in-filter-p-1, ibuffer-do-kill-lines)
(ibuffer-jump-to-buffer, ibuffer-mark-on-buffer)
(ibuffer-mark-by-name-regexp, ibuffer-mark-by-mode-regexp)
(ibuffer-mark-by-content-regexp, ibuffer-mark-by-mode)
(ibuffer-mark-modified-buffers, ibuffer-mark-unsaved-buffers)
(ibuffer-mark-dissociated-buffers, ibuffer-mark-help-buffers)
(ibuffer-mark-compressed-file-buffers, ibuffer-mark-old-buffers)
(ibuffer-mark-special-buffers, ibuffer-mark-read-only-buffers)
(ibuffer-mark-dired-buffers, ibuffer-do-occur):
* lisp/ibuf-macs.el (ibuffer-save-marks, define-ibuffer-sorter)
(define-ibuffer-op): Remove redundant #' before lambda.
2021-04-09 18:27:27 +02:00
Stefan Kangas
cdd72c5d89 Don't preserve window-line in tabulated-list-print
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-print): Don't
try to preserve window-line.  (Bug#42747)
2021-04-09 18:25:08 +02:00
Stefan Kangas
22515134ae Use lexical-binding in winner.el
* lisp/winner.el: Use lexical-binding.  Remove redundant :group
args.
(winner-set, winner-mode-map): Quote function symbols as such.
2021-04-09 16:40:03 +02:00
Stefan Monnier
e7ee3f7330 Merge branch 'vhdl-mode-lexbind' into trunk 2021-04-09 10:26:42 -04:00
Stefan Kangas
fb596973b9 Use lexical-binding in cmuscheme.el
* lisp/cmuscheme.el: Use lexical-binding.  Doc fixes.  Remove
redundant :group args.  Quote function symbols as such.
2021-04-09 16:12:35 +02:00
Stefan Kangas
caeb86b439 * lisp/progmodes/cmacexp.el: Use lexical-binding. 2021-04-09 15:20:56 +02:00
Stefan Kangas
064d933e20 Use lexical-binding in foldout.el
* lisp/foldout.el: Use lexical-binding.  Doc and formatting fixes.
Quote function symbols as such.
2021-04-09 14:54:04 +02:00
Stefan Kangas
841dcfa7c3 Use lexical-binding in loadhist.el and add tests
* lisp/loadhist.el: Use lexical-binding.
* test/lisp/loadhist-tests.el: New file.
2021-04-09 13:44:44 +02:00
Mattias Engdegård
612d731676 Self-TCO in condition-case error handlers
* lisp/emacs-lisp/cl-macs.el (cl--self-tco): Recognise
`condition-case` handlers as being in the tail position.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs--labels):
Extend test.
2021-04-09 10:55:37 +02:00
Jim Porter
1d42f4800b Fix hostname completion on MS Windows
* lisp/net/tramp.el (tramp-completion-file-name-regexp-default):
Handle volume letter being added to paths for file name completion on W32
systems.  This fixes hostname (and method) autocomplete on W32.

Copyright-paperwork-exempt: yes
2021-04-09 09:57:06 +02:00
Stefan Monnier
dfdec267ae * test/lisp/shadowfile-tests.el: Fix recent test failures
(shadow--tests-cleanup): `shadow-hashtable` is now a hash table (duh!).
2021-04-08 22:55:20 -04:00
Stefan Monnier
5b1e7af7bf * lisp/progmodes/vhdl-mode.el: Use lexical-binding
Use #' to quote function names to get better compiler diagnostics.
Wrap some lines to avoid arguments "hidden" in positions that are easy
to misread.
Prefix unused arguments with a semi-colon to silence compiler warnings.
Fix a few comments that used ;;; even though they were not headings.

(vhdl-emacs-21): Delete variable.
Replace all uses with (not (featurep 'xemacs)) instead since `vhdl-mode`
has been incompatible with Emacs<21 for more than 10 years already.
(vhdl-prepare-search-1): Add Edebug declaration.
(vhdl-prepare-search-2): Add Edebug declaration and use
`with-syntax-table`.
(vhdl-visit-file): Add Edebug and indentation declaration.
Move the bulk of the code to a function for easier debugging.
(vhdl--visit-file): New function extracted from `vhdl-visit-file`.
Be careful not to modify syntax tables in unrelated buffers.
(vhdl-speedbar-refresh): Remove unused var `pos`.
(vhdl-backward-sexp): Remove unused var `last-forward`.
(vhdl-electric-tab, vhdl-minibuffer-tab, vhdl-line-expand):
Rename arg to avoid conflict with the `prefix-arg`
global variable.
(vhdl-align-region-1): Remove unused var `indent`.
(vhdl-character-to-event): Actually give a body to that poor function.
(vhdl-template-context): Remove unused vars `entity-exists` and `string`.
(vhdl-template-group): Remove unused var `start`.
(vhdl-template-argument-list): Remove unused var `start`.
(vhdl-port-paste-context-clause): Remove unused var `margin`.
(vhdl-port-paste-testbench): Remove unused var `source-buffer`.
(vhdl-hs-minor-mode): Declare function `hs-hide-all`.
(vhdl-get-hierarchy): Rename arguments `ent-alist`, `conf-alist`, and
`conf-key` and bind those dynamically scoped var via `let` instead
since arguments can't be dynamically scoped.
(vhdl-speedbar-insert-hierarchy, vhdl-compose-configuration-architecture):
Same thing with arguments `ent-alist` and `conf-alist`.
(vhdl-cache-version): Declare variable.
(speedbar-expand-line, speedbar-edit-line): Declare functions.
(vhdl-speedbar-update-current-unit): Declare before first use.
(vhdl-compose-new-component): Remove unused var `project`.
(lazy-lock-minimum-size): Declare variable.
(vhdl-submit-bug-report): Declare variable `reporter-prompt-for-summary-p`.
2021-04-08 19:43:20 -04:00
Stefan Kangas
9a604501f0 Revert "Load all generic-x.el modes unconditionally"
This reverts commit 0161c9df6e.
2021-04-09 01:43:10 +02:00