]> git.eshelyaron.com Git - emacs.git/log
emacs.git
3 years agoFix two syntax errors in Specification List
Lars Ingebrigtsen [Mon, 15 Feb 2021 02:44:15 +0000 (03:44 +0100)]
Fix two syntax errors in Specification List

* doc/lispref/edebug.texi (Specification List): Add a couple of
missing @s.

3 years ago* Edebug: Generalize `&lookup`, use it for `cl-macrolet` and `cl-generic`
Stefan Monnier [Mon, 15 Feb 2021 02:13:35 +0000 (21:13 -0500)]
* Edebug: Generalize `&lookup`, use it for `cl-macrolet` and `cl-generic`

This allows the use of (declare (debug ...)) in the lexical macros
defined with `cl-macrolet`.  It also fixes the names used by Edebug
for the methods of `cl-generic` so it doesn't need to use gensym
and so they don't include the formal arg names any more.

* lisp/emacs-lisp/edebug.el (edebug--match-&-spec-op):
Rename from `edebug--handle-&-spec-op`.
(edebug--match-&-spec-op <&interpose>): Rename from `&lookup` and
generalize so it can let-bind dynamic variables around the rest of the parse.
(edebug-lexical-macro-ctx): Rename from `edebug--cl-macrolet-defs` and
make it into an alist.
(edebug-list-form-args): Use the specs from `edebug-lexical-macro-ctx`
when available.
(edebug--current-cl-macrolet-defs): Delete var.
(edebug-match-cl-macrolet-expr, edebug-match-cl-macrolet-name)
(edebug-match-cl-macrolet-body): Delete functions.
(def-declarations): Use new `&interpose`.
(edebug--match-declare-arg): Rename from `edebug--get-declare-spec` and
adjust to new calling convention.

* lisp/subr.el (def-edebug-elem-spec): Fix docstring.
(eval-after-load): Use `declare`.

* lisp/emacs-lisp/cl-generic.el: Fix Edebug names so we don't need
gensym any more and we only include the specializers but not the formal
arg names.
(cl--generic-edebug-name): New var.
(cl--generic-edebug-remember-name, cl--generic-edebug-make-name): New funs.
(cl-defgeneric, cl-defmethod): Use them.

* lisp/emacs-lisp/cl-macs.el: Add support for `debug` declarations in
`cl-macrolet`.
(cl-declarations-or-string):
Fix use of `lambda-doc` and allow use of `declare`.
(edebug-lexical-macro-ctx): Declare var.
(cl--edebug-macrolet-interposer): New function.
(cl-macrolet): Use it to pass the right `lexical-macro-ctx` to the body.

* lisp/emacs-lisp/pcase.el (pcase-PAT): Use new `&interpose`.
(pcase--edebug-match-pat-args): Rename from `pcase--get-edebug-spec` and
adjust to new calling convention.

* test/lisp/emacs-lisp/cl-generic-tests.el (cl-defgeneric/edebug/method):
Adjust to the new names.

* test/lisp/emacs-lisp/edebug-tests.el (edebug-cl-defmethod-qualifier)
(edebug-tests-cl-flet): Adjust to the new names.

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

3 years agoAvoid asking repeatedly about reloading bookmarks file
Stefan Kangas [Sun, 14 Feb 2021 23:43:15 +0000 (00:43 +0100)]
Avoid asking repeatedly about reloading bookmarks file

* lisp/bookmark.el (bookmark-maybe-load-default-file): Reload watched
bookmarks file only if its mtime has changed since the last query.
This avoids asking repeatedly about reloading the bookmarks file if
the user has already said "no" to a previous query.
(bookmark--watch-file-already-queried-p): New function.
(bookmark--watch-already-asked-mtime): New variable.

3 years agoMark up bookmark.el for correct modes
Stefan Kangas [Sun, 14 Feb 2021 20:37:23 +0000 (21:37 +0100)]
Mark up bookmark.el for correct modes

* lisp/bookmark.el: Mark up all commands with applicable modes.

3 years agoAdd a comment to `read-extended-command'
Lars Ingebrigtsen [Sun, 14 Feb 2021 21:57:19 +0000 (22:57 +0100)]
Add a comment to `read-extended-command'

* lisp/simple.el (read-extended-command): Add a comment.

3 years ago* src/xdisp.c (move_it_to): Fix last change. (Bug#46316)
Eli Zaretskii [Sun, 14 Feb 2021 20:11:05 +0000 (22:11 +0200)]
* src/xdisp.c (move_it_to): Fix last change.  (Bug#46316)

3 years agoAdd a possible completion predicate for buttons
Lars Ingebrigtsen [Sun, 14 Feb 2021 19:34:03 +0000 (20:34 +0100)]
Add a possible completion predicate for buttons

* lisp/simple.el (completion-at-point-p): New predicate.

* lisp/net/shr.el (shr-show-alt-text): Mark up as a button.

3 years agoMake completion-with-modes-p work with minor modes, too
Lars Ingebrigtsen [Sun, 14 Feb 2021 19:24:23 +0000 (20:24 +0100)]
Make completion-with-modes-p work with minor modes, too

* lisp/simple.el (completion-with-modes-p): Work with minor modes,
too.

3 years agoFix showing and hiding of tab-bar on new frames (bug#46299)
Bastian Beranek [Mon, 8 Feb 2021 17:12:33 +0000 (18:12 +0100)]
Fix showing and hiding of tab-bar on new frames (bug#46299)

* lisp/tab-bar.el (tab-bar--update-tab-bar-lines)
(tab-bar--tab-bar-lines-for-frame):
New functions to update value of tab-bar-lines in frames.
(tab-bar-mode, tab-bar-new-tab-to, tab-bar-close-tab)
(tab-bar-close-other-tab, tab-bar-show :set):
Use new function.
(tab-bar-select-tab-modifiers :set):
Work around visual glitch.

3 years agoDo command markup in blackbox.el
Lars Ingebrigtsen [Sun, 14 Feb 2021 17:14:36 +0000 (18:14 +0100)]
Do command markup in blackbox.el

3 years agoFix byte-run--set-modes call signature
Lars Ingebrigtsen [Sun, 14 Feb 2021 17:01:06 +0000 (18:01 +0100)]
Fix byte-run--set-modes call signature

* lisp/emacs-lisp/byte-run.el (byte-run--set-modes): We take a
list of modes, not a single one (and fix the quoting).

3 years agoFix missing ' in NEWS
Lars Ingebrigtsen [Sun, 14 Feb 2021 15:57:05 +0000 (16:57 +0100)]
Fix missing ' in NEWS

3 years agoAlso mention `M-o M-o' removal
Lars Ingebrigtsen [Sun, 14 Feb 2021 15:55:37 +0000 (16:55 +0100)]
Also mention `M-o M-o' removal

* lisp/loadup.el (facemenu-keymap-restore): Also restore `M-o M-o'.

3 years agoDon't update `minor-modes' in global modes
Lars Ingebrigtsen [Sun, 14 Feb 2021 15:51:14 +0000 (16:51 +0100)]
Don't update `minor-modes' in global modes

* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): There's no
point in setting the buffer-local `minor-modes' in global modes.

3 years agoMark up 5x5 for interactive mode
Lars Ingebrigtsen [Sun, 14 Feb 2021 15:18:39 +0000 (16:18 +0100)]
Mark up 5x5 for interactive mode

3 years ago; * doc/lispref/modes.texi: typo fix
Robert Pluim [Sun, 14 Feb 2021 14:05:58 +0000 (15:05 +0100)]
; * doc/lispref/modes.texi: typo fix

3 years agoFix problem with the newly introduces `minor-modes' variable
Lars Ingebrigtsen [Sun, 14 Feb 2021 13:43:24 +0000 (14:43 +0100)]
Fix problem with the newly introduces `minor-modes' variable

* lisp/help-fns.el (describe-mode): Apparently buffer-local
variables take precedence over lexically bound variables?

3 years agoDo `interactive' mode markup in all Gnus files
Lars Ingebrigtsen [Sun, 14 Feb 2021 13:14:48 +0000 (14:14 +0100)]
Do `interactive' mode markup in all Gnus files

3 years agoReally fix the syntax problem in define-minor-mode
Lars Ingebrigtsen [Sun, 14 Feb 2021 13:13:38 +0000 (14:13 +0100)]
Really fix the syntax problem in define-minor-mode

* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Fix
interactive extension in previous change.

3 years agoFix previous define-minor-mode change
Lars Ingebrigtsen [Sun, 14 Feb 2021 13:12:08 +0000 (14:12 +0100)]
Fix previous define-minor-mode change

* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Fix
interactive extension in previous change.

3 years agoMark up eww.el for correct modes
Lars Ingebrigtsen [Sun, 14 Feb 2021 13:08:56 +0000 (14:08 +0100)]
Mark up eww.el for correct modes

* lisp/net/eww.el: Mark up all commands with applicable modes.

3 years agoMake `C-h m' list unbound commands applicable for the mode
Lars Ingebrigtsen [Sun, 14 Feb 2021 13:07:48 +0000 (14:07 +0100)]
Make `C-h m' list unbound commands applicable for the mode

* lisp/help-fns.el (help-fns--list-local-commands): New function.
(describe-mode): Use it.

3 years agoAllow define-minor-mode to take an :interactive keyword
Lars Ingebrigtsen [Sun, 14 Feb 2021 13:06:16 +0000 (14:06 +0100)]
Allow define-minor-mode to take an :interactive keyword

* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Allow
specifying the :interactive state and the modes.

3 years agoFix dumping of buffers after minor_modes was added
Lars Ingebrigtsen [Sun, 14 Feb 2021 13:00:51 +0000 (14:00 +0100)]
Fix dumping of buffers after minor_modes was added

* src/pdumper.c (dump_buffer): Set minor_modes to nil before dumping.

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.