1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00
Commit graph

145430 commits

Author SHA1 Message Date
Stefan Monnier
fc4927fc3a * lisp/emacs-lisp/bindat.el: Expose the struct variable (bug#46534)
(bindat--unpack-group, bindat--length-group, bindat--pack-group):
Mark it as dynamically scoped.
2021-02-15 10:50:07 -05:00
Lars Ingebrigtsen
6ea920c88d Allow overriding declared predicates, too
* lisp/simple.el (completion-default-include-p): Rename and move
the checking for an explicit predicate down here...
(read-extended-command): ... from here.
(read-extended-command-predicate): Adjust default value.
2021-02-15 14:43:53 +01:00
Lars Ingebrigtsen
398811b7f6 Do `interactive' mode tagging in the remaining lisp/gnus files 2021-02-15 13:43:27 +01:00
Lars Ingebrigtsen
b535c8ba87 Add a new variable `global-minor-modes'
* doc/lispref/modes.texi (Minor Modes): Document it.
* lisp/simple.el (global-minor-modes): New variable.
(completion-in-mode-p): Use it.
(completion-with-modes-p): Use it.

* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Support it.
2021-02-15 13:08:21 +01:00
Lars Ingebrigtsen
0bd846c174 Rename minor-modes to local-minor-modes
* doc/lispref/modes.texi (Minor Modes): Update documentation.
* lisp/simple.el (completion-with-modes-p): Change usage.

* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Change usage.

* src/buffer.c: Rename from minor_modes to local_minor_modes
throughout.
(syms_of_buffer): Rename minor-modes to local-minor-modes.

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

* src/pdumper.c (dump_buffer): Update hash and usage.
2021-02-15 13:08:21 +01:00
Stefan Monnier
54e577fbc1 * lisp/emacs-lisp/edebug.el (edebug-&optional, edebug-&rest): Remove vars
According to my tests, `edebug-&optional` never has any effect.
And `edebug-&rest` can be replaced with a closure.

(edebug-&rest-wrapper): Remove function.
(edebug--match-&-spec-op): Use a closure to remember the `specs`.
2021-02-14 23:56:42 -05:00
Stefan Monnier
623e534e49 * lisp/emacs-lisp/byte-run.el (compiler-macro): Make it Edebuggable
* lisp/emacs-lisp/gv.el (gc-expander, gv-setter): Reuse the spec of
`compiler-macro`.
2021-02-14 23:03:04 -05:00
Lars Ingebrigtsen
2594162b23 Make the button completion predicate be more useful
* lisp/simple.el (completion-button-p): Rework from
`completion-at-point-p'.

* lisp/net/shr.el (shr-show-alt-text): It should be possible to
complete to commands that aren't bound to a key.
2021-02-15 04:42:32 +01:00
Lars Ingebrigtsen
df99b17e4f Speed up completion-in-mode-p in the common case
* lisp/simple.el (completion-in-mode-p): Make predicate more
efficient in the common one-mode case.
2021-02-15 04:22:29 +01:00
Lars Ingebrigtsen
a81dc34bab Fix two syntax errors in Specification List
* doc/lispref/edebug.texi (Specification List): Add a couple of
missing @s.
2021-02-15 03:44:15 +01:00
Stefan Monnier
b939f7ad35 * 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.
2021-02-14 21:34:09 -05:00
Stefan Kangas
f5b172fb6e 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.
2021-02-15 00:51:36 +01:00
Stefan Kangas
875ba6f7e7 Mark up bookmark.el for correct modes
* lisp/bookmark.el: Mark up all commands with applicable modes.
2021-02-14 23:57:55 +01:00
Lars Ingebrigtsen
58b9e84a31 Add a comment to `read-extended-command'
* lisp/simple.el (read-extended-command): Add a comment.
2021-02-14 22:57:38 +01:00
Eli Zaretskii
1c229d939b * src/xdisp.c (move_it_to): Fix last change. (Bug#46316) 2021-02-14 22:11:05 +02:00
Lars Ingebrigtsen
f02c93ae7a 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.
2021-02-14 20:34:03 +01:00
Lars Ingebrigtsen
02869b6c67 Make completion-with-modes-p work with minor modes, too
* lisp/simple.el (completion-with-modes-p): Work with minor modes,
too.
2021-02-14 20:24:23 +01:00
Bastian Beranek
27eaf37241 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.
2021-02-14 20:48:23 +02:00
Lars Ingebrigtsen
d6bfa30860 Do command markup in blackbox.el 2021-02-14 18:14:36 +01:00
Lars Ingebrigtsen
c339691772 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).
2021-02-14 18:01:06 +01:00
Lars Ingebrigtsen
aa3a48510b Fix missing ' in NEWS 2021-02-14 16:57:05 +01:00
Lars Ingebrigtsen
0334ac671c Also mention `M-o M-o' removal
* lisp/loadup.el (facemenu-keymap-restore): Also restore `M-o M-o'.
2021-02-14 16:55:37 +01:00
Lars Ingebrigtsen
2f00a3435a 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.
2021-02-14 16:51:14 +01:00
Lars Ingebrigtsen
1baadbe060 Mark up 5x5 for interactive mode 2021-02-14 16:18:47 +01:00
Robert Pluim
9b4a2dde78 ; * doc/lispref/modes.texi: typo fix 2021-02-14 15:05:58 +01:00
Lars Ingebrigtsen
4be98d5575 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?
2021-02-14 14:43:24 +01:00
Lars Ingebrigtsen
c0221990c4 Do `interactive' mode markup in all Gnus files 2021-02-14 14:14:48 +01:00
Lars Ingebrigtsen
869cdcf4e7 Really fix the syntax problem in define-minor-mode
* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Fix
interactive extension in previous change.
2021-02-14 14:13:38 +01:00
Lars Ingebrigtsen
07e6b29b12 Fix previous define-minor-mode change
* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Fix
interactive extension in previous change.
2021-02-14 14:12:08 +01:00
Lars Ingebrigtsen
ffca272678 Mark up eww.el for correct modes
* lisp/net/eww.el: Mark up all commands with applicable modes.
2021-02-14 14:08:56 +01:00
Lars Ingebrigtsen
98e3ee2747 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.
2021-02-14 14:07:48 +01:00
Lars Ingebrigtsen
40f7804ecb 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.
2021-02-14 14:06:16 +01:00
Lars Ingebrigtsen
a4c8b6e7c6 Fix dumping of buffers after minor_modes was added
* src/pdumper.c (dump_buffer): Set minor_modes to nil before dumping.
2021-02-14 14:00:51 +01:00
Lars Ingebrigtsen
8cdb61679e 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.
2021-02-14 13:57:59 +01:00
Lars Ingebrigtsen
c1ef7adeb6 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).
2021-02-14 13:56:53 +01:00
Lars Ingebrigtsen
2bfcd93e83 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.
2021-02-14 13:31:10 +01:00
Lars Ingebrigtsen
9291e7316f 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'.
2021-02-14 13:29:35 +01:00
Lars Ingebrigtsen
58e0c8ee86 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.
2021-02-14 13:21:24 +01:00
Lars Ingebrigtsen
8d517daf77 Fix how `shell-mode' avoids being called interactively
* lisp/shell.el (shell-mode): Make noninteractive instead of
erroring out after being called.
2021-02-14 12:58:20 +01:00
Lars Ingebrigtsen
43ecde8578 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.
2021-02-14 12:58:20 +01:00
Stefan Kangas
7f62faf206 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.
2021-02-14 12:54:36 +01:00
Lars Ingebrigtsen
760910f491 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_.
2021-02-14 12:37:44 +01:00
Stefan Monnier
103039b06c * lisp/emacs-lisp/edebug.el (edebug-make-enter-wrapper): Reinstate.
Removed by accident.
2021-02-13 19:24:33 -05:00
Stefan Monnier
2d9ff601ab * 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`.
2021-02-13 19:22:17 -05:00
Stefan Monnier
39a401ddae * 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`.
2021-02-13 17:50:31 -05:00
Alan Third
68bd6f3ea9 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.
2021-02-13 22:41:25 +00:00
Alan Third
0474a0d7d4 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.
2021-02-13 22:40:47 +00:00
Stefan Monnier
2007afd21b * 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`.
2021-02-13 16:21:53 -05:00
Philipp Stephani
e81cf63be1 * etc/NEWS: Document new JSON behavior. 2021-02-13 19:35:48 +01:00
Augusto Stoffel
6b0de9f830 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
2021-02-13 20:30:25 +02:00