]> git.eshelyaron.com Git - emacs.git/log
emacs.git
3 years agoRevert the bit about command_modes in previous patch set
Lars Ingebrigtsen [Sun, 14 Feb 2021 12:57:59 +0000 (13:57 +0100)]
Revert the bit about command_modes in previous patch set

* src/data.c (Fcommand_modes): Remove the subr bit -- it's not
necessary since it can just use a predicate.
* src/lisp.h (GCALIGNED_STRUCT): Remove command_modes.

* src/lread.c (defsubr): Remove command_modes.

3 years agoAdd 'read-extended-command-predicate'
Lars Ingebrigtsen [Sun, 14 Feb 2021 12:56:53 +0000 (13:56 +0100)]
Add 'read-extended-command-predicate'

* doc/emacs/m-x.texi (M-x): Document it.
* doc/lispref/commands.texi (Interactive Call): Document it further.

* lisp/simple.el (read-extended-command-predicate): New user option.
(read-extended-command-predicate): Use it.
(completion-in-mode-p): New function (the default predicate).

3 years agoMark easy-menu-do-define menus as "not interesting"
Lars Ingebrigtsen [Sun, 14 Feb 2021 12:31:10 +0000 (13:31 +0100)]
Mark easy-menu-do-define menus as "not interesting"

* lisp/emacs-lisp/easymenu.el (easy-menu-do-define): Mark menu
keymaps as "not interesting" when doing completion.

3 years agoAdd new 'declare' forms for command completion predicates
Lars Ingebrigtsen [Sun, 14 Feb 2021 12:29:35 +0000 (13:29 +0100)]
Add new 'declare' forms for command completion predicates

* doc/lispref/functions.texi (Declare Form): Document the new
`completion' and `modes' declarations.
* lisp/simple.el (completion-with-modes-p): New helper functions.

* lisp/emacs-lisp/byte-run.el (byte-run--set-completion)
(byte-run--set-modes):
(defun-declarations-alist): New declarations for `completion' and
`modes'.

3 years agoExtend the syntax of `interactive' to list applicable modes
Lars Ingebrigtsen [Sun, 14 Feb 2021 12:21:24 +0000 (13:21 +0100)]
Extend the syntax of `interactive' to list applicable modes

* doc/lispref/commands.texi (Using Interactive): Document the
extended `interactive' form.
* doc/lispref/loading.texi (Autoload): Document list-of-modes
form.

* lisp/emacs-lisp/autoload.el (make-autoload): Pick the list of
modes from `interactive' out of the functions.

* lisp/emacs-lisp/bytecomp.el (byte-compile-lambda): Allow for the
extended `interactive' form.

* src/callint.c (Finteractive): Document the extended form.

* src/data.c (Finteractive_form): Return the interactive form in
the old format (even when there's an extended `interactive') to
avoid having other parts of Emacs be aware of this.
(Fcommand_modes): New defun.

* src/emacs-module.c (GCALIGNED_STRUCT): Allow for modules to
return command modes.

* src/lisp.h: New function module_function_command_modes.

3 years agoFix how `shell-mode' avoids being called interactively
Lars Ingebrigtsen [Sun, 14 Feb 2021 11:52:00 +0000 (12:52 +0100)]
Fix how `shell-mode' avoids being called interactively

* lisp/shell.el (shell-mode): Make noninteractive instead of
erroring out after being called.

3 years agoIntroduce an :interactive keyword for `defined-derived-mode'
Lars Ingebrigtsen [Sun, 14 Feb 2021 11:50:19 +0000 (12:50 +0100)]
Introduce an :interactive keyword for `defined-derived-mode'

* doc/lispref/modes.texi (Derived Modes): Document it.
* lisp/emacs-lisp/derived.el (define-derived-mode): Introduce a
new :interactive keyword.

3 years agoRemove redundant :group args from textmodes/*.el
Stefan Kangas [Sun, 14 Feb 2021 11:54:36 +0000 (12:54 +0100)]
Remove redundant :group args from textmodes/*.el

* lisp/textmodes/enriched.el:
* lisp/textmodes/ispell.el:
* lisp/textmodes/makeinfo.el:
* lisp/textmodes/paragraphs.el:
* lisp/textmodes/picture.el:
* lisp/textmodes/refbib.el:
* lisp/textmodes/refer.el:
* lisp/textmodes/remember.el:
* lisp/textmodes/texinfo.el:
* lisp/textmodes/tildify.el:
* lisp/textmodes/two-column.el: Remove redundant :group args.

3 years agoAdd a new buffer-local variable `minor-modes'
Lars Ingebrigtsen [Sun, 14 Feb 2021 11:37:44 +0000 (12:37 +0100)]
Add a new buffer-local variable `minor-modes'

* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Keep
`minor-modes' updated.
* src/buffer.c (bset_minor_modes, Fmake_indirect_buffer)
(reset_buffer, init_buffer_once): Initialise `minor-modes'.
(syms_of_buffer): Add `minor-modes' as a new permanently-local
variable.

* src/buffer.h (struct buffer): Add minor_modes_.

3 years ago* lisp/emacs-lisp/edebug.el (edebug-make-enter-wrapper): Reinstate.
Stefan Monnier [Sun, 14 Feb 2021 00:24:33 +0000 (19:24 -0500)]
* lisp/emacs-lisp/edebug.el (edebug-make-enter-wrapper): Reinstate.

Removed by accident.

3 years ago* lisp/emacs-lisp/edebug.el: Fix `called-interactively-p`
Stefan Monnier [Sun, 14 Feb 2021 00:22:17 +0000 (19:22 -0500)]
* lisp/emacs-lisp/edebug.el: Fix `called-interactively-p`

And get rid of the old special-case handling of `interactive-p`, which
is now redundant.

(edebug--called-interactively-skip): Fix lexical-binding case,
and adjust to some formerly missed call patterns.
(edebug-def-interactive, edebug-interactive-p): Remove vars.
(edebug-interactive-p-name, edebug-wrap-def-body)
(edebug-make-enter-wrapper): Remove functions.
(edebug-list-form): Don't special-case `interactive-p`.

3 years ago* lisp/emacs-lisp/edebug.el (edebug-match-lambda-expr): Delete function
Stefan Monnier [Sat, 13 Feb 2021 22:50:31 +0000 (17:50 -0500)]
* lisp/emacs-lisp/edebug.el (edebug-match-lambda-expr): Delete function

(lambda-expr): Define with `def-edebug-elem-spec` instead.
(edebug--handle-&-spec-op): Remove left over code.
(interactive): Re-add mistakenly removed spec elem.

* doc/lispref/edebug.texi (Specification List): Remove `function-form`.

3 years agoFix flicker when resizing NS frame programmatically (bug#46155)
Alan Third [Sun, 31 Jan 2021 20:19:53 +0000 (20:19 +0000)]
Fix flicker when resizing NS frame programmatically (bug#46155)

; Incidentally fixes bug#21326.

* src/nsterm.m ([EmacsView viewWillDraw]): New function.
([EmacsView viewDidResize:]): We now have to mark the frame for
display on resize.
([EmacsView initFrameFromEmacs:]): Retain frame contents on resize.
([EmacsView updateLayer]): Don't update the layer if the frame is
still garbaged.

3 years agoRemove aliasing on SVG images under scaled NS frames
Alan Third [Wed, 10 Feb 2021 22:12:16 +0000 (22:12 +0000)]
Remove aliasing on SVG images under scaled NS frames

* src/image.c (FRAME_SCALE_FACTOR): New #define for getting frame
scale factor.
(image_set_transform):
(svg_load_image): Use FRAME_SCALE_FACTOR.
* src/nsterm.m (ns_frame_scale_factor): Get the scale factor for an NS
frame.

3 years ago* lisp/emacs-lisp/edebug.el (edebug--handle-&-spec-op <&name>): New method
Stefan Monnier [Sat, 13 Feb 2021 21:21:53 +0000 (16:21 -0500)]
* lisp/emacs-lisp/edebug.el (edebug--handle-&-spec-op <&name>): New method

(edebug--concat-name): New function.
(edebug-match-name, edebug-match-cl-generic-method-qualifier)
(edebug-match-cl-generic-method-args): Delete functions.

* doc/lispref/edebug.texi (Specification List): Document it.

* lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Use `&name`.
(cl-generic--method-qualifier-p): New predicate.
(cl-defmethod): Use it and `&name`.
* lisp/emacs-lisp/cl-macs.el (cl-defun, cl-iter-defun, cl-flet):
* lisp/emacs-lisp/eieio-compat.el (defmethod):
* lisp/emacs-lisp/gv.el (gv-define-setter):
* lisp/emacs-lisp/ert.el (ert-deftest): Use `&name`.
* lisp/erc/erc-backend.el (define-erc-response-handler): Use `declare`
and `&name`.

3 years ago* etc/NEWS: Document new JSON behavior.
Philipp Stephani [Sat, 13 Feb 2021 18:35:26 +0000 (19:35 +0100)]
* etc/NEWS: Document new JSON behavior.

3 years agoSmall correction to `isearch-lazy-highlight-buffer-update'
Augusto Stoffel [Fri, 12 Feb 2021 18:29:54 +0000 (19:29 +0100)]
Small correction to `isearch-lazy-highlight-buffer-update'

The value of point is now read after a potential change of buffer.
* lisp/isearch.el (isearch-lazy-highlight-buffer-update): Move call
to `point' after `select-window'.

Copyright-paperwork-exempt: yes

3 years ago(backtrace-goto-source-functions): Make it a normal abnormal hook
Stefan Monnier [Sat, 13 Feb 2021 15:41:45 +0000 (10:41 -0500)]
(backtrace-goto-source-functions): Make it a normal abnormal hook

* lisp/emacs-lisp/backtrace.el (backtrace-goto-source-functions):
Don't mark it as buffer-local any more.
(backtrace-goto-source): Use `run-hook-with-args-until-success`.

* lisp/emacs-lisp/edebug.el (edebug-pop-to-backtrace): Clarify that the
hook is only intended to be modified buffer-locally.

3 years agoFix I-search at EOB when long lines are truncated
Eli Zaretskii [Sat, 13 Feb 2021 15:27:02 +0000 (17:27 +0200)]
Fix I-search at EOB when long lines are truncated

* src/xdisp.c (move_it_to): Fix logic when TO_CHARPOS is at the
end of an hscrolled line which ends at EOB.  (Bug#46316)

3 years ago; * src/json.c (Fjson_parse_string): Fix the doc string.
Eli Zaretskii [Sat, 13 Feb 2021 14:10:53 +0000 (16:10 +0200)]
; * src/json.c (Fjson_parse_string): Fix the doc string.

3 years agoPass 'struct json_configuration' as const where possible.
Philipp Stephani [Sat, 13 Feb 2021 13:35:30 +0000 (14:35 +0100)]
Pass 'struct json_configuration' as const where possible.

The JSON serialization and parsing functions don't need to modify
these structures.

* src/json.c (lisp_to_json_nonscalar_1, lisp_to_json_nonscalar)
(lisp_to_json, json_to_lisp): Mark configuration object parameter as
const.

3 years agoAllow any JSON value at the top level (Bug#42994).
Philipp Stephani [Sat, 13 Feb 2021 13:25:42 +0000 (14:25 +0100)]
Allow any JSON value at the top level (Bug#42994).

Newer standards like RFC 8259, which obsoletes the earlier RFC 4627,
now allow any top-level value unconditionally, so Emacs should too.

* src/json.c (Fjson_serialize, Fjson_insert): Pass JSON_ENCODE_ANY to
allow serialization of any JSON value.  Call 'lisp_to_json' instead of
'lisp_to_json_toplevel'.  Remove obsolete comments
(neither JSON_DECODE_ANY nor JSON_ALLOW_NUL are allowed here).  Reword
documentation strings.
(Fjson_parse_string, Fjson_parse_buffer): Pass JSON_DECODE_ANY to
allow deserialization of any JSON value.  Reword documentation
strings.
(lisp_to_json_nonscalar, lisp_to_json_nonscalar_1): Rename from
"toplevel" to avoid confusion.
(lisp_to_json): Adapt caller.
* test/src/json-tests.el (json-serialize/roundtrip-scalars): New unit
test.
* doc/lispref/text.texi (Parsing JSON): Update documentation.

3 years agoRemove stale comments from gnus-msg.el
Basil L. Contovounesios [Sat, 13 Feb 2021 12:47:59 +0000 (12:47 +0000)]
Remove stale comments from gnus-msg.el

* lisp/gnus/gnus-msg.el (gnus-group-mail, gnus-group-news)
(gnus-summary-mail-other-window, gnus-summary-news-other-window):
Remove stale comments about let-binding gnus-newsgroup-name, as they
should have been addressed (bug#37871#38).

3 years agoFix vertical cursor motion among many images
Eli Zaretskii [Sat, 13 Feb 2021 12:57:25 +0000 (14:57 +0200)]
Fix vertical cursor motion among many images

* src/xdisp.c (move_it_in_display_line_to): Consider it
MOVE_POS_MATCH_OR_ZV if we are just after an image, stretch, or
display string, and the position matches exactly.  This is needed
when one image follows another at TO_CHARPOS.  (Bug#46464)

3 years agoadd-minor-mode doc string clarification
Lars Ingebrigtsen [Sat, 13 Feb 2021 11:46:34 +0000 (12:46 +0100)]
add-minor-mode doc string clarification

* lisp/subr.el (add-minor-mode): Clarify that this function isn't
only about XEmacs compat stuff.

3 years agoDelete 20 year old comment in executable.el
Stefan Kangas [Sat, 13 Feb 2021 06:22:44 +0000 (07:22 +0100)]
Delete 20 year old comment in executable.el

* lisp/progmodes/executable.el (executable-insert): Delete 20 year old
comment.

3 years agoRemove redundant :group args in progmodes/*.el
Stefan Kangas [Sat, 13 Feb 2021 04:18:55 +0000 (05:18 +0100)]
Remove redundant :group args in progmodes/*.el

* lisp/progmodes/bug-reference.el:
* lisp/progmodes/cfengine.el:
* lisp/progmodes/cmacexp.el:
* lisp/progmodes/cpp.el:
* lisp/progmodes/cwarn.el:
* lisp/progmodes/dcl-mode.el:
* lisp/progmodes/executable.el:
* lisp/progmodes/flymake.el:
* lisp/progmodes/gud.el:
* lisp/progmodes/hideshow.el:
* lisp/progmodes/icon.el:
* lisp/progmodes/inf-lisp.el:
* lisp/progmodes/js.el:
* lisp/progmodes/ld-script.el:
* lisp/progmodes/make-mode.el:
* lisp/progmodes/modula2.el:
* lisp/progmodes/pascal.el:
* lisp/progmodes/perl-mode.el:
* lisp/progmodes/prog-mode.el:
* lisp/progmodes/simula.el:
* lisp/progmodes/xscheme.el: Remove redundant :group args.

3 years agoEdebug: Make it possible to debug `gv-expander`s in `declare`
Stefan Monnier [Sat, 13 Feb 2021 03:53:38 +0000 (22:53 -0500)]
Edebug: Make it possible to debug `gv-expander`s in `declare`

Arrange for declarations to be able to specify their own specs via
the `edebug-declaration-spec` property.

* lisp/emacs-lisp/edebug.el: (edebug--get-declare-spec): New function.
(def-declarations): New spec element.
(defun, defmacro): Use it in their spec.

* lisp/emacs-lisp/gv.el (gv-expander, gv-setter):
Set `edebug-declaration-spec`.

* test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-gv-expander): New test.

* test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el
(edebug-test-code-use-gv-expander): New test case.

3 years agoComment out mysterious code from cperl-mode.el
Stefan Kangas [Fri, 12 Feb 2021 23:21:36 +0000 (00:21 +0100)]
Comment out mysterious code from cperl-mode.el

* lisp/progmodes/cperl-mode.el: Comment out mysterious code referring
to some unknown variable 'edit-var-mode-alist'.  No one seems to know
what it is used for, so comment it out and see if anyone complains
before Emacs 28.1 or 28.2.

3 years agoRemove outdated documentation from cperl-mode.el
Stefan Kangas [Fri, 12 Feb 2021 23:10:38 +0000 (00:10 +0100)]
Remove outdated documentation from cperl-mode.el

* lisp/progmodes/cperl-mode.el (cperl-tips, cperl-problems)
(cperl-praise, cperl-speed, cperl-mode): Doc fixes; remove references
to very old versions of Emacs and other "Emaxen".
(cperl-problems-old-emaxen): Make obsolete and remove information on
Emacs 20.3 and older.

3 years agoEdebug: Overload `edebug-form-spec` even less
Stefan Monnier [Sat, 13 Feb 2021 00:28:25 +0000 (19:28 -0500)]
Edebug: Overload `edebug-form-spec` even less

The `edebug-form-spec` symbol property was used both to map forms's
head symbol to the corresponding spec, and to map spec element names
to their expansion.

This lead to name conflicts which break instrumentation of examples such as

    (cl-flet ((gate (x) x)) (gate 4))

because of the Edebug spec element `gate`.
So introduce a new symbol property `edebug-elem-spec`.

* lisp/subr.el (def-edebug-elem-spec): New function.

* lisp/emacs-lisp/edebug.el (edebug--get-elem-spec): New function.
(edebug-match-symbol): Use it.
(Core Edebug elems): Put them on `edebug-elem-spec` instead of
`edebug-form-spec`.
(ELisp special forms): Set their `edebug-form-spec` via dolist.
(Other non-core Edebug elems): Use `def-edebug-elem-spec`.
(edebug-\`): Use `declare`.

* lisp/emacs-lisp/pcase.el (pcase-PAT, pcase-FUN, pcase-QPAT):
* lisp/skeleton.el (skeleton-edebug-spec):
* lisp/emacs-lisp/cl-macs.el: Use `def-edebug-elem-spec`.

* test/lisp/emacs-lisp/edebug-tests.el
(edebug-tests--conflicting-internal-names): New test.
* test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el
(edebug-test-code-cl-flet1): New test case.

* doc/lispref/edebug.texi (Specification List): Add `def-edebug-elem-spec`.
(Specification Examples): Use it.

* doc/lispref/loading.texi (Hooks for Loading): Avoid the use of
`def-edebug-spec` in example (better use `debug` declaration).

3 years agoRemove XEmacs and Emacs 21 compat code from cperl-mode
Stefan Kangas [Fri, 12 Feb 2021 18:07:12 +0000 (19:07 +0100)]
Remove XEmacs and Emacs 21 compat code from cperl-mode

* lisp/progmodes/cperl-mode.el (cperl-mode): Remove XEmacs and
Emacs 21 compat code.
(cperl-compilation-error-regexp-list): New variable.
(cperl-compilation-error-regexp-alist): Make obsolete.

3 years agoFix ElDoc setup for eval-expression
Basil L. Contovounesios [Fri, 12 Feb 2021 21:26:08 +0000 (21:26 +0000)]
Fix ElDoc setup for eval-expression

* lisp/emacs-lisp/eldoc.el (eldoc--eval-expression-setup): Don't set
global value of eldoc-documentation-strategy (bug#44886).

3 years agoUse `declare` instead of `def-edebug-spec` in most places
Stefan Monnier [Fri, 12 Feb 2021 21:08:01 +0000 (16:08 -0500)]
Use `declare` instead of `def-edebug-spec` in most places

* lisp/speedbar.el: Use lexical-binding.
(speedbar-with-writable): Use `declare`.

* lisp/subr.el (def-edebug-spec): Use `declare`.

* lisp/cedet/ede/base.el: Use lexical-binding.
(ede-with-projectfile): Use `declare`.
(recentf-exclude): Declare var.

* lisp/cedet/ede/pmake.el: Use lexical-binding.
(ede-pmake-insert-variable-shared, ede-pmake-insert-variable-once):
Use `declare`.

* lisp/cedet/ede/proj-comp.el: Use lexical-binding.
(ede-compiler-begin-unique, ede-compiler-only-once)
(ede-linker-begin-unique, ede-linker-only-once): Use `declare`.

* lisp/cedet/semantic/ctxt.el: Use lexical-binding.
(semantic-with-buffer-narrowed-to-context)
(semantic-with-buffer-narrowed-to-command): Use `declare`.
(semantic--progress-reporter): Declare var.
(semantic-ctxt-end-of-symbol-default): Remove unused var `fieldsep`.

* lisp/cedet/semantic/lex-spp.el: Use lexical-binding.
(define-lex-spp-macro-declaration-analyzer)
(define-lex-spp-include-analyzer, semantic-lex-with-macro-used)
(define-lex-spp-macro-undeclaration-analyzer): Use `declare`.
(semantic-lex-spp-symbol-remove): Rename arg to avoid colliding with
dynamic variable `obarray`.
(semantic-lex-spp-symbol-pop): Remove unused var `oldvalue`.
(semantic-lex-spp-lex-text-string): Remove unused var `analyzer`.

* lisp/cedet/semantic/lex.el (define-lex)
(semantic-lex-unterminated-syntax-protection, define-lex-analyzer)
(define-lex-regex-analyzer, define-lex-block-analyzer)
(semantic-lex-catch-errors): Use `declare`.

* lisp/cedet/semantic/tag.el: Use lexical-binding.
(semantic-with-buffer-narrowed-to-current-tag)
(semantic-with-buffer-narrowed-to-tag): Use `declare`.

* lisp/cedet/semantic/wisent.el: Use lexical-binding.
(define-wisent-lexer): Use `declare`.

* lisp/emacs-lisp/cl-lib.el (cl-pushnew): The arg to :test can be any
form not just function form.

* lisp/org/ob-comint.el (org-babel-comint-in-buffer)
(org-babel-comint-with-output): Use `declare`.

* lisp/org/ob-core.el (org-babel-map-src-blocks): Use `declare`.
(org-babel-result-cond): Simplify edebug spec.

* lisp/org/org-clock.el (org-with-clock-position, org-with-clock):
* lisp/org/org-agenda.el (org-agenda-with-point-at-orig-entry):
* lisp/org/ob-tangle.el (org-babel-with-temp-filebuffer): Use `declare`.

* lisp/textmodes/rst.el (push): Remove redundant edebug spec.

* lisp/vc/pcvs-parse.el: Use lexical-binding.
(cvs-parse-buffer): Rename arg to avoid dynbound conflict.
(cvs-or): Use `declare`.

3 years agoSimplify expression in byte-code decompiler
Mattias Engdegård [Fri, 12 Feb 2021 18:43:41 +0000 (19:43 +0100)]
Simplify expression in byte-code decompiler

* lisp/emacs-lisp/byte-opt.el (byte-decompile-bytecode-1):
Replace roundabout expression with what it essentially does.

3 years agobyte-opt.el: More concise expression
Mattias Engdegård [Fri, 12 Feb 2021 18:41:07 +0000 (19:41 +0100)]
byte-opt.el: More concise expression

* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Refactor `setq` clause.

3 years agoAvoid traversing dead `if` branches in bytecode optimiser
Mattias Engdegård [Thu, 11 Feb 2021 16:34:17 +0000 (17:34 +0100)]
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.

3 years agoDon't inline tramp-debug-message
Mattias Engdegård [Thu, 11 Feb 2021 19:41:02 +0000 (20:41 +0100)]
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.

3 years ago; Fix typo in last change to m4-mode.el.
Basil L. Contovounesios [Fri, 12 Feb 2021 18:21:45 +0000 (18:21 +0000)]
; Fix typo in last change to m4-mode.el.

3 years ago; Fix recent regexp-opt conversion in cperl-mode
Stefan Kangas [Fri, 12 Feb 2021 17:38:58 +0000 (18:38 +0100)]
; 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>.

3 years agoUse regexp-opt for font lock defaults in meta-mode.el
Stefan Kangas [Fri, 12 Feb 2021 04:39:44 +0000 (05:39 +0100)]
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.

3 years agoMinor cleanups in scheme.el
Stefan Kangas [Fri, 12 Feb 2021 04:30:32 +0000 (05:30 +0100)]
Minor cleanups in scheme.el

* lisp/progmodes/scheme.el: Remove redundant :group args.
(dsssl-font-lock-keywords): Use regexp-opt.

3 years agoAdd font locking for many missing macros in m4-mode
Stefan Kangas [Fri, 12 Feb 2021 04:15:01 +0000 (05:15 +0100)]
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.

3 years ago* lisp/emacs-lisp/edebug.el (edebug--handle-&-spec-op) <&lookup>: New method
Stefan Monnier [Fri, 12 Feb 2021 17:17:40 +0000 (12:17 -0500)]
* 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.

3 years ago* lisp/emacs-lisp/cl-macs.el (cl-flet): Fix edebug spec
Stefan Monnier [Fri, 12 Feb 2021 16:37:49 +0000 (11:37 -0500)]
* lisp/emacs-lisp/cl-macs.el (cl-flet): Fix edebug spec

3 years ago* lisp/emacs-lisp/edebug.el: Misc cleanups.
Stefan Monnier [Fri, 12 Feb 2021 16:12:49 +0000 (11:12 -0500)]
* 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`.

3 years agoRemove Motif support
Robert Pluim [Fri, 12 Feb 2021 10:43:02 +0000 (11:43 +0100)]
Remove Motif support

* configure.ac: Remove support for configuring --with-x-toolkit=motif

* etc/NEWS: Mention removal of Motif support.

3 years agoAllow minor modes to specify major modes they're useful in
Lars Ingebrigtsen [Fri, 12 Feb 2021 13:19:50 +0000 (14:19 +0100)]
Allow minor modes to specify major modes they're useful in

3 years ago* lisp/emacs-lisp/gv.el (gv-place): Simplify
Stefan Monnier [Fri, 12 Feb 2021 00:06:30 +0000 (19:06 -0500)]
* lisp/emacs-lisp/gv.el (gv-place): Simplify

3 years ago* lisp/cedet/semantic/symref/: Use lexical-binding
Stefan Monnier [Fri, 12 Feb 2021 00:00:53 +0000 (19:00 -0500)]
* 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.

3 years ago* lisp/cedet/semantic/decorate/: Use lexical-binding in all files
Stefan Monnier [Thu, 11 Feb 2021 23:54:12 +0000 (18:54 -0500)]
* 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.

3 years agoMake recursive minibuffers and recursive edits work together
Alan Mackenzie [Thu, 11 Feb 2021 21:37:45 +0000 (21:37 +0000)]
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).

3 years agoUse lexical-binding in erc-sound.el
Stefan Kangas [Thu, 11 Feb 2021 20:30:23 +0000 (21:30 +0100)]
Use lexical-binding in erc-sound.el

* lisp/erc/erc-sound.el: Use lexical-binding.  Remove redundant :group
args.

3 years agoDrop XEmacs and SXEmacs support from EDE
Stefan Kangas [Thu, 11 Feb 2021 20:08:17 +0000 (21:08 +0100)]
Drop XEmacs and SXEmacs support from EDE

* lisp/cedet/ede/emacs.el (ede-emacs-version): Drop XEmacs and
SXEmacs support from EDE.

3 years agoUse lexical-binding in various ede files
Stefan Kangas [Thu, 11 Feb 2021 19:59:41 +0000 (20:59 +0100)]
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.

3 years agoUse lexical-binding in wid-browse.el
Stefan Kangas [Thu, 11 Feb 2021 19:21:16 +0000 (20:21 +0100)]
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.

3 years ago* lisp/ps-samp.el: Use lexical-binding.
Stefan Kangas [Thu, 11 Feb 2021 19:10:31 +0000 (20:10 +0100)]
* lisp/ps-samp.el: Use lexical-binding.

3 years agoFix two Emacs version references in misc manuals
Stefan Kangas [Thu, 11 Feb 2021 18:18:38 +0000 (19:18 +0100)]
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.

3 years ago; Fix lexical-binding conversion of semantic/bovine/gcc.el
Stefan Kangas [Thu, 11 Feb 2021 14:40:45 +0000 (15:40 +0100)]
; 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.

3 years agoFix Octave double-quoted string line continuations
Basil L. Contovounesios [Wed, 10 Feb 2021 01:30:08 +0000 (01:30 +0000)]
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.

3 years agoUse frame monitor in frame_float
Andrii Kolomoiets [Thu, 11 Feb 2021 09:09:41 +0000 (10:09 +0100)]
Use frame monitor in frame_float

* src/frame.c (frame_float): Use frame monitor attributes instead
of attributes of the main monitor (bug#46406).

3 years agoAvoid having erc in irrelevant finder categories
Stefan Kangas [Wed, 10 Feb 2021 19:58:16 +0000 (20:58 +0100)]
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.

3 years ago* lisp/progmodes/cperl-mode.el (cperl-init-faces): Use regexp-opt.
Stefan Kangas [Wed, 10 Feb 2021 19:54:48 +0000 (20:54 +0100)]
* lisp/progmodes/cperl-mode.el (cperl-init-faces): Use regexp-opt.

3 years ago* lisp/play/decipher.el: Use lexical-binding
Stefan Monnier [Wed, 10 Feb 2021 22:47:18 +0000 (17:47 -0500)]
* 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`.

3 years ago* lisp/leim/quail: Use lexical-binding
Stefan Monnier [Wed, 10 Feb 2021 22:37:25 +0000 (17:37 -0500)]
* 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`.

3 years ago* lisp/leim/quail: Use lexical-binding
Stefan Monnier [Wed, 10 Feb 2021 22:35:31 +0000 (17:35 -0500)]
* 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`.

3 years ago* lisp/subr.el (combine-change-calls-1): Don't presume integer args
Stefan Monnier [Wed, 10 Feb 2021 21:39:53 +0000 (16:39 -0500)]
* 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.

3 years ago* lisp/emacs-lisp/macroexp.el (macroexp--fgrep): Break cycles
Stefan Monnier [Wed, 10 Feb 2021 21:06:24 +0000 (16:06 -0500)]
* lisp/emacs-lisp/macroexp.el (macroexp--fgrep): Break cycles

* test/lisp/emacs-lisp/macroexp-tests.el: New file.

3 years agoFix ediff even/odd faces to increase their contrast and readability
Juri Linkov [Wed, 10 Feb 2021 19:37:47 +0000 (21:37 +0200)]
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).

3 years agoFix build problem with previous facemenu change
Lars Ingebrigtsen [Wed, 10 Feb 2021 19:37:10 +0000 (20:37 +0100)]
Fix build problem with previous facemenu change

* lisp/facemenu.el (facemenu-add-face-function): Move to avoid a
warning.
(list-colors-display): Autoload.

3 years agoSimplify and speed up after-find-file
Paul Eggert [Wed, 10 Feb 2021 18:55:42 +0000 (10:55 -0800)]
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.

3 years agoFix file lock issue (Bug#46397)
Paul Eggert [Wed, 10 Feb 2021 18:50:44 +0000 (10:50 -0800)]
Fix file lock issue (Bug#46397)

* src/filelock.c (current_lock_owner):
Also treat ENOTDIR as meaning the lock file does not exist.

3 years agoRemove the 'M-o' ('facemap-keymap') binding experimentally
Lars Ingebrigtsen [Wed, 10 Feb 2021 18:38:10 +0000 (19:38 +0100)]
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.

3 years ago* lisp/emacs-lisp/edebug.el: Tweak last change
Stefan Monnier [Wed, 10 Feb 2021 18:12:09 +0000 (13:12 -0500)]
* 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`.

3 years agoUse lexical-binding in dns-mode.el
Stefan Kangas [Wed, 10 Feb 2021 17:42:52 +0000 (18:42 +0100)]
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.

3 years agoUse lexical-binding in mail-utils.el and add tests
Stefan Kangas [Wed, 10 Feb 2021 16:31:17 +0000 (17:31 +0100)]
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.

3 years ago* list/emacs-lisp/edebug.el: Don't overload `edebug-form-spec`
Stefan Monnier [Wed, 10 Feb 2021 17:36:36 +0000 (12:36 -0500)]
* 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`.

3 years agoBump FACE_CACHE_BUCKETS_SIZE to 1009
Eli Zaretskii [Wed, 10 Feb 2021 16:10:17 +0000 (18:10 +0200)]
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>.

3 years agoFix local defvar scoping error (bug#46387)
Mattias Engdegård [Wed, 10 Feb 2021 13:26:49 +0000 (14:26 +0100)]
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.

3 years agoMinor cleanup in imenu.el
Stefan Kangas [Wed, 10 Feb 2021 13:10:10 +0000 (14:10 +0100)]
Minor cleanup in imenu.el

* lisp/imenu.el: Doc fix; these examples have been removed.  Remove
redundant :group args.

3 years agoUse lexical-binding in snmp-mode.el
Stefan Kangas [Wed, 10 Feb 2021 13:08:01 +0000 (14:08 +0100)]
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.

3 years agoDeclare empty macro imenu-progress-menu obsolete
Stefan Kangas [Wed, 10 Feb 2021 12:59:09 +0000 (13:59 +0100)]
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.

3 years agoUpdate NEWS entry for vc-dir faces
Protesilaos Stavrou [Wed, 10 Feb 2021 04:03:33 +0000 (06:03 +0200)]
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.

3 years ago* lisp/cedet/semantic/bovine/gcc.el: Use lexical-binding.
Stefan Kangas [Wed, 10 Feb 2021 12:21:34 +0000 (13:21 +0100)]
* lisp/cedet/semantic/bovine/gcc.el: Use lexical-binding.

3 years agoMove cedet test resource files to follow our conventions
Stefan Kangas [Wed, 10 Feb 2021 11:44:07 +0000 (12:44 +0100)]
Move cedet test resource files to follow our conventions

* test/lisp/cedet/semantic-utest-ia.el (ert, ert-x): Require.
(cedet-utest-directory, semantic-utest-test-directory): Remove
variables.
(semantic-utest-ia-doublens.cpp, semantic-utest-ia-subclass.cpp)
(semantic-utest-ia-typedefs.cpp, semantic-utest-ia-struct.cpp)
(semantic-utest-ia-templates.cpp, semantic-utest-ia-using.cpp)
(semantic-utest-ia-nsp.cpp, semantic-utest-ia-localvars.cpp)
(semantic-utest-ia-namespace.cpp)
(semantic-utest-ia-sppcomplete.c, semantic-utest-ia-varnames.c)
(semantic-utest-ia-javacomp.java)
(semantic-utest-ia-varnames.java, semantic-utest-ia-wisent.wy)
(semantic-utest-ia-texi, semantic-utest-ia-make)
(semantic-utest-ia-srecoder): Use 'ert-resource-file'.  Don't
check if file exists; we can assume that it does.

* test/manual/cedet/tests/testjavacomp.java:
* test/manual/cedet/tests/testlocalvars.cpp:
* test/manual/cedet/tests/testnsp.cpp:
* test/manual/cedet/tests/testsppcomplete.c:
* test/manual/cedet/tests/teststruct.cpp:
* test/manual/cedet/tests/testsubclass.cpp:
* test/manual/cedet/tests/testsubclass.hh:
* test/manual/cedet/tests/testtemplates.cpp:
* test/manual/cedet/tests/testtypedefs.cpp:
* test/manual/cedet/tests/testusing.cpp:
* test/manual/cedet/tests/testusing.hh:
* test/manual/cedet/tests/testvarnames.c:
* test/manual/cedet/tests/testvarnames.java:
* test/manual/cedet/tests/testwisent.wy: Move from here...
* test/lisp/cedet/semantic-utest-ia-resources/testjavacomp.java:
* test/lisp/cedet/semantic-utest-ia-resources/testlocalvars.cpp:
* test/lisp/cedet/semantic-utest-ia-resources/testnsp.cpp:
* test/lisp/cedet/semantic-utest-ia-resources/testsppcomplete.c:
* test/lisp/cedet/semantic-utest-ia-resources/teststruct.cpp:
* test/lisp/cedet/semantic-utest-ia-resources/testsubclass.cpp:
* test/lisp/cedet/semantic-utest-ia-resources/testsubclass.hh:
* test/lisp/cedet/semantic-utest-ia-resources/testtemplates.cpp:
* test/lisp/cedet/semantic-utest-ia-resources/testtypedefs.cpp:
* test/lisp/cedet/semantic-utest-ia-resources/testusing.cpp:
* test/lisp/cedet/semantic-utest-ia-resources/testusing.hh:
* test/lisp/cedet/semantic-utest-ia-resources/testvarnames.c:
* test/lisp/cedet/semantic-utest-ia-resources/testvarnames.java:
* test/lisp/cedet/semantic-utest-ia-resources/testwisent.wy:
...to here.

3 years agoConvert tests for srecode/fields.el to ert
Stefan Kangas [Wed, 10 Feb 2021 11:20:32 +0000 (12:20 +0100)]
Convert tests for srecode/fields.el to ert

* test/manual/cedet/srecode-tests.el: Move from here...
* test/lisp/cedet/srecode/fields-tests.el: ...to here.
(srecode-field-utest-impl): Convert test to ert.  Silence
byte-compiler.

* test/manual/cedet/cedet-utests.el (cedet-utest-libs): Don't
list the above moved file.

3 years ago; * test/lisp/cedet/semantic/format-tests.el: Minor cleanup.
Stefan Kangas [Wed, 10 Feb 2021 05:40:13 +0000 (06:40 +0100)]
; * test/lisp/cedet/semantic/format-tests.el: Minor cleanup.

3 years agoMake texinfmt-version variable obsolete
Stefan Kangas [Wed, 10 Feb 2021 03:48:43 +0000 (04:48 +0100)]
Make texinfmt-version variable obsolete

* lisp/textmodes/texinfmt.el (texinfmt-version): Make variable and
command obsolete in favour of 'emacs-version'.
(texinfo-format-region, texinfo-format-buffer-1): Use
'emacs-version' instead of above obsolete variable.

3 years agoUse lexical-binding in bib-mode.el
Stefan Kangas [Wed, 10 Feb 2021 03:42:37 +0000 (04:42 +0100)]
Use lexical-binding in bib-mode.el

* lisp/textmodes/bib-mode.el: Use lexical-binding.  Remove
redundant :group args.

3 years agoMove semantic/format.el tests to follow our conventions
Stefan Kangas [Wed, 10 Feb 2021 03:14:48 +0000 (04:14 +0100)]
Move semantic/format.el tests to follow our conventions

* test/lisp/cedet/semantic-utest-fmt.el: Move from here...
* test/lisp/cedet/semantic/format-tests.el: ...to here.
(ert, ert-x): Require.
(semantic-fmt-utest-file-list): Use ert-resource-file.
* test/manual/cedet/tests/test-fmt.cpp:
* test/manual/cedet/tests/test-fmt.el: Move from here...
* test/lisp/cedet/semantic/format-resources/test-fmt.cpp:
* test/lisp/cedet/semantic/format-resources/test-fmt.el: ...to here.

3 years agoUse lexical-binding in some test files
Stefan Kangas [Wed, 10 Feb 2021 02:06:27 +0000 (03:06 +0100)]
Use lexical-binding in some test files

* test/manual/cedet/ede-tests.el:
* test/manual/cedet/srecode-tests.el:
* test/manual/cedet/tests/test.el: Use lexical-binding.

* test/manual/etags/el-src/TAGTEST.EL: Add lexical-binding cookie.
* test/manual/etags/ETAGS.good_1: Update expected result for the
above change.

3 years agoChange default semantic-lex-analyzer to semantic-lex
Stefan Kangas [Wed, 10 Feb 2021 02:02:03 +0000 (03:02 +0100)]
Change default semantic-lex-analyzer to semantic-lex

* lisp/cedet/semantic/lex.el (semantic-lex-analyzer): Change default
to semantic-lex, since semantic-flex was obsolete and has been
removed.

3 years agoConvert many manual cedet tests to ert
Stefan Kangas [Wed, 10 Feb 2021 01:07:55 +0000 (02:07 +0100)]
Convert many manual cedet tests to ert

* test/manual/cedet/cedet-utests.el
(cedet-files-utest): Move test from here...
* test/lisp/cedet/cedet-files-tests.el: ...to this new file.

* test/manual/cedet/srecode-tests.el
(srecode-document-function-comment-extract-test): Move test from
here...
* test/lisp/cedet/srecode/document-tests.el: ...to this new file.

* test/manual/cedet/cedet-utests.el
(inversion-unit-test): Move test from here...
* test/lisp/cedet/inversion-tests.el: ...to this new file.

* test/manual/cedet/semantic-tests.el
(semantic-gcc-test-output-parser): Move test from here...
* test/lisp/cedet/semantic/bovine/gcc-tests.el: ...to this new file.

* test/manual/cedet/semantic-tests.el
(semantic-test-data-cache): Move test from here...
* test/lisp/cedet/semantic/fw-tests.el: ...to this new file.

3 years agoUse lexical-binding in almost all of play/*.el
Stefan Kangas [Wed, 10 Feb 2021 00:23:41 +0000 (01:23 +0100)]
Use lexical-binding in almost all of play/*.el

* lisp/play/5x5.el: Use lexical-binding.
(5x5-draw-grid-end, 5x5-draw-grid, 5x5-solver)
(5x5-solve-suggest): Silence byte-compiler.

* lisp/play/cookie1.el: Use lexical-binding.
(cookie-shuffle-vector, cookie-apropos): Silence byte-compiler.

* lisp/play/zone.el: Use lexical-binding.
(zone): Convert lambda to proper lexical closure.
(zone-replace-char, zone-fill-out-screen): Silence byte-compiler.

* lisp/play/blackbox.el:
* lisp/play/doctor.el:
* lisp/play/gametree.el:
* lisp/play/hanoi.el: Use lexical-binding.

* test/lisp/play/cookie1-resources/cookies:
* test/lisp/play/cookie1-tests.el: New files.

3 years agoRefine use of vc-dir faces; apply to all backends
Protesilaos Stavrou [Tue, 9 Feb 2021 04:49:05 +0000 (06:49 +0200)]
Refine use of vc-dir faces; apply to all backends

* lisp/vc/vc-dir.el (vc-default-dir-printer): Add check for the
"ignored" status and make 'vc-dir-status-edited' the default face.
Also extend condition for more states that qualify as "warnings".

(vc-dir-ignored, vc-dir-status-ignored): Rename face for consistency.

* lisp/vc/vc-git.el (vc-git-dir-printer): Use the
'vc-dir-status-edited' as the default for the Git backend.  And
reference the renamed face.  Also stop treating the empty stash
differently from other header values.

* lisp/vc/vc-bzr.el (vc-bzr-dir-extra-headers): Implement new faces.
* lisp/vc/vc-cvs.el (vc-cvs-dir-extra-headers): Same.
* lisp/vc/vc-hg.el (vc-hg-dir-extra-headers): Same.
* lisp/vc/vc-svn.el (vc-svn-dir-extra-headers): Same.

This follows from the discussion in bug#46358.

3 years ago; Fix warning in last change to semantic/idle.el.
Basil L. Contovounesios [Tue, 9 Feb 2021 19:04:58 +0000 (19:04 +0000)]
; Fix warning in last change to semantic/idle.el.

3 years agoTiny simplification to read-char-by-name
Basil L. Contovounesios [Tue, 9 Feb 2021 18:59:24 +0000 (18:59 +0000)]
Tiny simplification to read-char-by-name

* lisp/international/mule-cmds.el (mule--ucs-names-sort-by-code):
Sort with car-less-than-car instead of slower lambda.
(mule--ucs-names-affixation): Just stick character into a list to
avoid trip through format and char-to-string.
(read-char-by-name): Quote function symbols as such.

3 years agoFix syntax category of some characters
Eli Zaretskii [Tue, 9 Feb 2021 18:57:29 +0000 (20:57 +0200)]
Fix syntax category of some characters

* lisp/international/characters.el (modify-syntax-entry): Fix
syntax of numerical subscripts and superscripts.  (Bug#46240)

3 years ago* lisp/net/dictionary.el: Dictionary improvements (bug#45262)
Juri Linkov [Tue, 9 Feb 2021 18:29:54 +0000 (20:29 +0200)]
* lisp/net/dictionary.el: Dictionary improvements (bug#45262)

* lisp/net/dictionary.el (dictionary-link-dictionary): New defcustom.
(dictionary-mark-reference): Use dictionary-link-dictionary.
(dictionary-post-buffer-hook): New defcustom.
(dictionary-post-buffer): Run dictionary-post-buffer-hook.
(dictionary-mode-map): Bind 'S-SPC' to scroll-down-command.
(dictionary-search-default): Use possibly multi-word data at point.

3 years agoUse lexical-binding in a few more scattered files
Stefan Monnier [Tue, 9 Feb 2021 18:27:08 +0000 (13:27 -0500)]
Use lexical-binding in a few more scattered files

* lisp/registry.el: Use lexical-binding.
(registry-reindex): Remove unused var `values`.

* lisp/cedet/pulse.el: Use lexical-binding.

* lisp/cedet/semantic/idle.el: Use lexical-binding.
(semantic-idle-core-handler): Remove unused var `safe`.
(ede-auto-add-method): Declare var.
(define-semantic-idle-service): Use `declare`.  Remove unused var `setup`.
(pulse-flag): Declare var.

* lisp/net/ldap.el: Use lexical-binding.
(ldap-search-internal): Remove unused var `proc`.

* lisp/net/mairix.el: Use lexical-binding.
Remove redundant `:group` args.
(mairix-widget-create-query): Remove unnused var `allwidgets`.