1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00
Commit graph

145363 commits

Author SHA1 Message Date
Mattias Engdegård
9518926220 Simplify expression in byte-code decompiler
* lisp/emacs-lisp/byte-opt.el (byte-decompile-bytecode-1):
Replace roundabout expression with what it essentially does.
2021-02-12 20:52:05 +01:00
Mattias Engdegård
5a11e9185c byte-opt.el: More concise expression
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Refactor `setq` clause.
2021-02-12 20:52:05 +01:00
Mattias Engdegård
ea29908c18 Avoid traversing dead if branches in bytecode optimiser
There is no point in traversing conditional branches that are
statically known never to be executed.  This saves some optimisation
effort, but more importantly prevents variable assignments and
references in those branches from blocking effective constant
propagation.

Also attempt to traverse as much as possible in an unconditional
context, which enables constant-propagation through (linear)
assignments.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-form):
Rewrite the (tail) recursion into an explicit loop.  Normalise a
return value of (quote nil) to nil, for easier subsequent
optimisations.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Don't
traverse dead `if` branches.  Use unconditional traversion context
when possible.
2021-02-12 20:52:05 +01:00
Mattias Engdegård
c4459a10a6 Don't inline tramp-debug-message
* lisp/net/tramp.el (tramp-debug-message): Change defsubst into defun.
Until now the byte-compiler hasn't been clever enough to inline this
function but this is about to change; the code expansion is
unnecessary and makes compiler improvements more difficult to gauge.
2021-02-12 20:52:05 +01:00
Basil L. Contovounesios
b24ae269b2 ; Fix typo in last change to m4-mode.el. 2021-02-12 18:21:45 +00:00
Stefan Kangas
733dfe244b ; Fix recent regexp-opt conversion in cperl-mode
* lisp/progmodes/cperl-mode.el (cperl-init-faces): Add missing
identifiers found by static analysis of recent change.
Thanks to Mattias Engdegård <mattiase@acm.org>.
2021-02-12 18:50:55 +01:00
Stefan Kangas
fffe88bf62 Use regexp-opt for font lock defaults in meta-mode.el
* lisp/progmodes/meta-mode.el: Remove redundant :group args.

(meta-font-lock-keywords): Use regexp-opt.
2021-02-12 18:50:55 +01:00
Stefan Kangas
a799f6d9d8 Minor cleanups in scheme.el
* lisp/progmodes/scheme.el: Remove redundant :group args.
(dsssl-font-lock-keywords): Use regexp-opt.
2021-02-12 18:50:55 +01:00
Stefan Kangas
506b8d725a Add font locking for many missing macros in m4-mode
* lisp/progmodes/m4-mode.el (m4--macro-list): New variable.
(m4-font-lock-keywords): Use regexp-opt and add many missing macros
sourced from the M4 manual.
2021-02-12 18:50:55 +01:00
Stefan Monnier
c7b35ea306 * lisp/emacs-lisp/edebug.el (edebug--handle-&-spec-op) <&lookup>: New method
* doc/lispref/edebug.texi (Specification List): Document it.

* lisp/emacs-lisp/pcase.el (pcase-PAT): Use it.
(pcase-MACRO): Remove Edebug element.
(pcase--get-edebug-spec): New function.
(pcase--edebug-match-macro): Remove function.
2021-02-12 12:17:40 -05:00
Stefan Monnier
6ae731e04f * lisp/emacs-lisp/cl-macs.el (cl-flet): Fix edebug spec 2021-02-12 11:37:49 -05:00
Stefan Monnier
1d2487b1fc * lisp/emacs-lisp/edebug.el: Misc cleanups.
Move all definitions under the `edebug-` prefix.

(edebug-get-spec): Rename from `get-edebug-spec`.
(edebug-move-cursor): Use `cl-callf`.
(edebug-spec-p): Remove unused function.
(def-edebug-spec, edebug-spec-list, edebug-spec): Remove unused specs
(nothing in there gets instrumented anyway).
(edebug-tracing): Use `declare`.
(edebug-cancel-on-entry): Rename from `cancel-edebug-on-entry`.
(edebug-global-prefix): Rename from `global-edebug-prefix`.
(edebug-global-map): Rename from `global-edebug-map`.

* lisp/emacs-lisp/pcase.el (pcase-PAT): Remove `let`.
(let): Use `declare` instead.
(pcase--edebug-match-macro): Use new name `edebug-get-spec`.
2021-02-12 11:13:39 -05:00
Robert Pluim
db237850ab Remove Motif support
* configure.ac: Remove support for configuring --with-x-toolkit=motif

* etc/NEWS: Mention removal of Motif support.
2021-02-12 14:47:13 +01:00
Lars Ingebrigtsen
6a2cdc67fa Allow minor modes to specify major modes they're useful in 2021-02-12 14:19:55 +01:00
Stefan Monnier
3a4b65177f * lisp/emacs-lisp/gv.el (gv-place): Simplify 2021-02-11 19:06:30 -05:00
Stefan Monnier
c55f4055dd * lisp/cedet/semantic/symref/: Use lexical-binding
* lisp/cedet/semantic/symref/cscope.el:
* lisp/cedet/semantic/symref/filter.el:
* lisp/cedet/semantic/symref/global.el:
* lisp/cedet/semantic/symref/grep.el:
* lisp/cedet/semantic/symref/idutils.el:
* lisp/cedet/semantic/symref/list.el: Use lexical-binding.
2021-02-11 19:00:53 -05:00
Stefan Monnier
9451ea0a05 * lisp/cedet/semantic/decorate/: Use lexical-binding in all files
* lisp/cedet/semantic/decorate/include.el
(semantic-decoration-fileless-include-describe): Remove unused var `mm`.
* lisp/cedet/semantic/decorate/mode.el: Use lexical-binding.
2021-02-11 18:54:12 -05:00
Alan Mackenzie
203e61ff83 Make recursive minibuffers and recursive edits work together
* lisp/minibuffer.el (exit-minibuffer): When in a minibuffer, throw an error
should the command loop nesting level be wrong.

* src/lisp.h (minibuffer_quit_level): declare as an extern.
(command_loop_level): Move definition from src/window.h

* src/window.h (command_loop_level): move definition to src/lisp.h.

* src/eval.c (minibuffer_quit_level): Move this variable to file level from
being a static inside internal_catch.
(internal_catch): Simplify the logic.

* src/minibuf.c (Vcommand_loop_level_list): New variable.
(move_minibuffer_onto_frame): Set the major mode of  *Minibuf-0*.
(Fminibuffer_innermost_command_loop_p): New primitive.
(Fabort_minibuffers): Check the command loop level before throwing t to 'exit,
and set minibuffer_quit_level too.
(read_minibuf): New variable calling_window.
Before stacking up minibuffers on the current mini-window, check that the
mini-window is not the current one.
Do not call choose_minibuf_frame from read_minibuf's unwinding process.
Bind calling_frame and calling_window over the recursive edit.
Set the new minibuffer's major mode directly.
Remove the switching away from the minibuffer after the recursive edit.
(get_minibuffer): Record the command loop level in new variable
Vcommand_loop_level_list.  No longer set the major mode of a returned
minibuffer.
(minibuf_c_loop_level): New function.
(read_minibuf_unwind): New variables calling_frame, calling_window are unbound
from the binding stack.  Remove old variable `window', which could not be set
reliably to the expired mini-window.
The expired minibuffer is determined as the nth in the list, rather than the
contents of the current or previous mini-window.
Switch the current window away from the mini-window here (moved from
read_minibuf).
2021-02-11 21:37:45 +00:00
Stefan Kangas
4f63b4bfc6 Use lexical-binding in erc-sound.el
* lisp/erc/erc-sound.el: Use lexical-binding.  Remove redundant :group
args.
2021-02-11 21:41:58 +01:00
Stefan Kangas
0bcec1e4ae Drop XEmacs and SXEmacs support from EDE
* lisp/cedet/ede/emacs.el (ede-emacs-version): Drop XEmacs and
SXEmacs support from EDE.
2021-02-11 21:41:58 +01:00
Stefan Kangas
f29c7d61d7 Use lexical-binding in various ede files
* lisp/cedet/ede/dired.el:
* lisp/cedet/ede/emacs.el:
* lisp/cedet/ede/make.el:
* lisp/cedet/ede/proj-archive.el:
* lisp/cedet/ede/proj-aux.el:
* lisp/cedet/ede/proj-misc.el:
* lisp/cedet/ede/proj-scheme.el:
* lisp/cedet/ede/srecode.el:
* lisp/cedet/ede/system.el: Use lexical-binding.
2021-02-11 21:41:58 +01:00
Stefan Kangas
a24be5ef7e Use lexical-binding in wid-browse.el
* lisp/wid-browse.el: Use lexical-binding.
(widget-browse-mode): Use define-derived-mode.
(widget-browse-mode-hook): Remove redundant :group arg.
(widget-browse-action, widget-browse-value-create): Doc fixes.
2021-02-11 20:26:15 +01:00
Stefan Kangas
c99460cbf6 * lisp/ps-samp.el: Use lexical-binding. 2021-02-11 20:10:31 +01:00
Stefan Kangas
c553fdc80c Fix two Emacs version references in misc manuals
* doc/misc/forms.texi: Fix reference to Emacs version.
* doc/misc/remember.texi: Fix version reference to indicate Emacs
version instead of version of remember.  The corresponding version
variable and header have been marked obsolete.
2021-02-11 19:21:48 +01:00
Stefan Kangas
b3362f7b70 ; Fix lexical-binding conversion of semantic/bovine/gcc.el
* lisp/cedet/semantic/bovine/gcc.el (semantic-gcc-get-include-paths):
Fix sorting and comparison after previous lexical-binding conversion.
2021-02-11 16:12:02 +01:00
Basil L. Contovounesios
21ec45c107 Fix Octave double-quoted string line continuations
* lisp/progmodes/octave.el (octave-string-continuation-marker): New
defconst after octave-continuation-string.
(octave-continuation-string): Mention it in docstring.
(octave-maybe-insert-continuation-string): Mark unused function as
obsolete.
(octave-help-function): Simplify action.
(octave--indent-new-comment-line): Insert
octave-string-continuation-marker instead of
octave-continuation-string within double-quoted strings (bug#46420).
(octave-indent-new-comment-line):
* etc/NEWS: Describe new behavior.
2021-02-11 14:35:47 +00:00
Andrii Kolomoiets
0e2b123a4e Use frame monitor in frame_float
* src/frame.c (frame_float): Use frame monitor attributes instead
of attributes of the main monitor (bug#46406).
2021-02-11 10:09:41 +01:00
Stefan Kangas
aaa80f408c Avoid having erc in irrelevant finder categories
* lisp/erc/erc-backend.el:
* lisp/erc/erc-button.el:
* lisp/erc/erc-dcc.el:
* lisp/erc/erc-identd.el:
* lisp/erc/erc-join.el:
* lisp/erc/erc-lang.el:
* lisp/erc/erc-log.el:
* lisp/erc/erc-match.el:
* lisp/erc/erc-menu.el:
* lisp/erc/erc-pcomplete.el:
* lisp/erc/erc-replace.el:
* lisp/erc/erc-spelling.el:
* lisp/erc/erc-stamp.el:
* lisp/erc/erc-track.el:
* lisp/erc/erc-xdcc.el: Remove irrelevant entries in Keywords header.
2021-02-11 00:06:36 +01:00
Stefan Kangas
ad3e5da953 * lisp/progmodes/cperl-mode.el (cperl-init-faces): Use regexp-opt. 2021-02-11 00:06:36 +01:00
Stefan Monnier
1be27e3bf3 * lisp/play/decipher.el: Use lexical-binding
(decipher-mode-syntax-table): Move initialization into declaration.
(decipher-mode, decipher-stats-mode): Use `define-derived-mode`.
(decipher-stats-buffer): Use `buffer-local-value`.
2021-02-10 17:47:18 -05:00
Stefan Monnier
1b4435e6ea * lisp/leim/quail: Use lexical-binding
* lisp/leim/quail/hangul.el:
* lisp/leim/quail/indian.el:
* lisp/leim/quail/ipa.el:
* lisp/leim/quail/japanese.el:
* lisp/leim/quail/lao.el:
* lisp/leim/quail/latin-ltx.el:
* lisp/leim/quail/lrt.el:
* lisp/leim/quail/sisheng.el:
* lisp/leim/quail/thai.el:
* lisp/leim/quail/tibetan.el: Use lexical-binding.
* lisp/leim/quail/uni-input.el (ucs-input-method): Remove unused var `str`.
2021-02-10 17:37:25 -05:00
Stefan Monnier
8d33cc53a2 * lisp/leim/quail: Use lexical-binding
* lisp/leim/quail/hangul.el:
* lisp/leim/quail/indian.el:
* lisp/leim/quail/ipa.el:
* lisp/leim/quail/japanese.el:
* lisp/leim/quail/lao.el:
* lisp/leim/quail/latin-ltx.el:
* lisp/leim/quail/lrt.el:
* lisp/leim/quail/sisheng.el:
* lisp/leim/quail/thai.el:
* lisp/leim/quail/tibetan.el: Use lexical-binding.
* lisp/leim/quail/uni-input.el (ucs-input-method): Remove unused var `str`.
2021-02-10 17:35:31 -05:00
Stefan Monnier
5a598fa414 * lisp/subr.el (combine-change-calls-1): Don't presume integer args
This avoids problems where the `after-change-functions` end up called
with the new length rather than the old length.
2021-02-10 16:39:53 -05:00
Stefan Monnier
29c47ac19a * lisp/emacs-lisp/macroexp.el (macroexp--fgrep): Break cycles
* test/lisp/emacs-lisp/macroexp-tests.el: New file.
2021-02-10 16:06:24 -05:00
Juri Linkov
6bfdfeed36 Fix ediff even/odd faces to increase their contrast and readability
* lisp/vc/ediff-init.el (ediff-even-diff-A, ediff-even-diff-B)
(ediff-even-diff-C, ediff-even-diff-Ancestor, ediff-odd-diff-A)
(ediff-odd-diff-B, ediff-odd-diff-C): Add :distant-foreground
"Black" for light background.  For dark background
add :distant-foreground "White", and use darker shades of grey
for background colors (bug#46396).
2021-02-10 21:38:43 +02:00
Lars Ingebrigtsen
81e55fa6c3 Fix build problem with previous facemenu change
* lisp/facemenu.el (facemenu-add-face-function): Move to avoid a
warning.
(list-colors-display): Autoload.
2021-02-10 20:37:14 +01:00
Paul Eggert
4467073c50 Simplify and speed up after-find-file
Use newer primitives like file-accessible-directory-p to simplify
and speed up longstanding code in after-find-file.
* lisp/files.el (after-find-file):
Prefer file-exists-p + file-symlink-p to file-attributes +
file-symlink-p + file-chase-links + file-exists-p.
Prefer file-accessible-directory-p to directory-file-name +
file-attributes.
Prefer file-directory-p to file-name-directory + file-exists-p.
2021-02-10 10:58:40 -08:00
Paul Eggert
4459dcc078 Fix file lock issue (Bug#46397)
* src/filelock.c (current_lock_owner):
Also treat ENOTDIR as meaning the lock file does not exist.
2021-02-10 10:58:40 -08:00
Lars Ingebrigtsen
21e475ea0c Remove the 'M-o' ('facemap-keymap') binding experimentally
* doc/lispref/maps.texi (Standard Keymaps):
* doc/lispref/keymaps.texi (Prefix Keys): Remove mentions.

* etc/facemenu-removal.txt: New temporary file.

* lisp/loadup.el: Don't load facemenu.el.
(removed-facemenu-command): New command.
(facemenu-keymap-restore): New function.

* lisp/textmodes/text-mode.el (center-paragraph): Remove binding.
(center-line): Remove binding.
2021-02-10 19:38:18 +01:00
Stefan Monnier
2e5d400ca6 * lisp/emacs-lisp/edebug.el: Tweak last change
Use generic functions i.s.o `edebug--spec-op-function`.

<toplevel>: No need to register the &foo and :foo handler any more.
(edebug--handle-&-spec-op, edebug--handle-:-spec-op): New generic functions.
(edebug-match-specs): Use them.
(edebug--get-spec-op): Remove function.
(edebug-match-&optional, edebug-match-&rest, edebug-match-&or)
(edebug-match-&not, edebug-match-&key, edebug-match-&error)
(edebug-match-&define): Turn functions into methods of
`edebug--handle-&-spec-op`.
(edebug-match-:name, edebug-match-:unique): Turn functions into methods of
`edebug--handle-:-spec-op`.
2021-02-10 13:12:09 -05:00
Stefan Kangas
dcfb8f6b61 Use lexical-binding in dns-mode.el
* lisp/textmodes/dns-mode.el: Use lexical-binding.  Remove
redundant :group args.
* test/lisp/textmodes/dns-mode-tests.el
(dns-mode-tests-dns-mode-soa-increment-serial): New test.
2021-02-10 18:44:43 +01:00
Stefan Kangas
8147bf5812 Use lexical-binding in mail-utils.el and add tests
* lisp/mail/mail-utils.el: Use lexical-binding.
* test/lisp/mail/mail-utils-tests.el: New file.
2021-02-10 18:44:43 +01:00
Stefan Monnier
d6eddf2c07 * list/emacs-lisp/edebug.el: Don't overload edebug-form-spec
The `edebug-form-spec` symbol property was used to store two different things:
the handlers for spec elements like `body` and the handlers for
spec operators like `&or`.  But these two sets use different calling
conventions, so they're fundamentally incompatible.

So, move the handlers to spec operators to the new property
`edebug--spec-op-function`.  This unbreaks Edebugging of:

    (cl-flet ((f (&rest x) x)) 3)

* lisp/emacs-lisp/edebug.el <toplevel>: Split the alist of built in
spec elements into normal spec element and spec ops.
(edebug--get-spec-op): New function.
(edebug-match-specs): Use it.
(edebug-match-:name): Rename from `edebug-match-colon-name`.
2021-02-10 12:36:36 -05:00
Eli Zaretskii
9b0d76e93b Bump FACE_CACHE_BUCKETS_SIZE to 1009
* src/xfaces.c (FACE_CACHE_BUCKETS_SIZE): Make it 1009, a prime
number, per the comment.  Reported by Win Treese <treese@acm.org>.
2021-02-10 18:10:17 +02:00
Mattias Engdegård
f3ae26cb2a Fix local defvar scoping error (bug#46387)
This bug was introduced by the lexical variable constant propagation
mechanism.  It was discovered by Michael Heerdegen.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-let-form)
(byte-optimize-body): Let the effects of a local defvar declaration be
scoped by let and let*, not any arbitrary Lisp expression body (such
as progn).
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--get-vars)
(bytecomp-local-defvar): New test.
2021-02-10 14:47:40 +01:00
Stefan Kangas
d9af416701 Minor cleanup in imenu.el
* lisp/imenu.el: Doc fix; these examples have been removed.  Remove
redundant :group args.
2021-02-10 14:42:51 +01:00
Stefan Kangas
553613e7ca Use lexical-binding in snmp-mode.el
* lisp/net/snmp-mode.el: Use lexical-binding.  Remove redundant :group
args.  Doc fix; remove outdated information.
(snmp-mode, snmpv2-mode): Add FIXME to use define-derived-mode.
2021-02-10 14:42:51 +01:00
Stefan Kangas
70d562b43e Declare empty macro imenu-progress-menu obsolete
* lisp/imenu.el: Remove commented out code.
(imenu-progress-message): Declare macro obsolete.

* lisp/erc/erc-imenu.el (erc-create-imenu-index):
* lisp/net/snmp-mode.el (snmp-mode-imenu-create-index):
* lisp/progmodes/antlr-mode.el (antlr-imenu-create-index-function):
Don't use or mention above obsolete macro.
2021-02-10 14:42:51 +01:00
Protesilaos Stavrou
d0826e592a Update NEWS entry for vc-dir faces
* NEWS: Remove reference to specific backend, as it now applies to all
of them.  Update name of 'vc-dir-status-ignored'.

This follows from the discussion in bug#46358.
2021-02-10 15:31:19 +02:00
Stefan Kangas
30f3b9f847 * lisp/cedet/semantic/bovine/gcc.el: Use lexical-binding. 2021-02-10 13:21:34 +01:00