summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/easy-mmode.el
Commit message (Collapse)AuthorAge
* Merge commit '1bc9dfc5bee'Stefan Monnier2023-03-27
|\
| * ; Improve documentation of :predicate in globalized minor modesEli Zaretskii2023-03-23
| | | | | | | | | | | | | | * doc/lispref/modes.texi (Defining Minor Modes): * lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Improve documentation of the :predicate keyword in defining globalized minor modes.
| * Fix :predicate handling in globalized minor modesStefan Monnier2023-03-23
| | | | | | | | | | * lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Fix a thinko. (Bug#62376)
* | Styled quotes in compiler warningsMattias EngdegÄrd2023-01-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/byte-run.el (byte-run--parse-body) (byte-run--unescaped-character-literals-warning): * lisp/emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment) (byte-compile-form, bytecomp--warn-dodgy-eq-arg): * lisp/emacs-lisp/cconv.el (cconv--warn-unused-msg): * lisp/emacs-lisp/cl-macs.el (cl-defstruct): * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): * lisp/emacs-lisp/eieio.el (defclass): * lisp/emacs-lisp/macroexp.el (macroexp--unfold-lambda) (macroexp--expand-all): * lisp/emacs-lisp/pcase.el (pcase--u1): * lisp/subr.el (when, unless, ignore-error, lsh, sit-for) (with-demoted-errors): Use format-message to ensure properly styled quotes in compiler warning messages.
* | Merge from origin/emacs-29Eli Zaretskii2023-01-01
|\| | | | | | | | | | | | | | | | | | | | | cae528457c ; Add 2023 to copyright years. b394359261 Improve documentation of 'isearch-open-overlay-temporary' ab3210e709 Document 'use-package' in the 2 main manuals # Conflicts: # etc/refcards/ru-refcard.tex # lib/explicit_bzero.c # m4/explicit_bzero.m4
| * ; Add 2023 to copyright years.Eli Zaretskii2023-01-01
| |
| * Fix gud-minor-mode-menuEli Zaretskii2022-12-03
| | | | | | | | | | | | | | * lisp/emacs-lisp/easy-mmode.el (define-minor-mode) (easy-mmode-define-keymap): Don't declare obsolete, since we are still using it in gud.el. (Bug#59769) (Bug#59605) Do not merge to master.
| * Revert "Make easy-mmode-defmap obsolete and adjust only caller"Eli Zaretskii2022-12-03
|/ | | | | | | | This reverts commit 8bb5c1bfec0929f2ba419e1c503f5acc01c336c2. That commit lost too many useful features in the GUD menus and caused several bugs, the last of them bug#59769. Do not merge to master.
* Fix define-minor-mode :keymap obsoletion warningLars Ingebrigtsen2022-09-02
| | | | | * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Fix some warning.
* Make easy-mmode-define-keymap obsoleteLars Ingebrigtsen2022-09-01
| | | | | | * lisp/emacs-lisp/easy-mmode.el (easy-mmode-define-keymap): Make obsolete. (define-minor-mode): Add comment.
* Make easy-mmode-defmap obsolete and adjust only callerLars Ingebrigtsen2022-09-01
| | | | | * lisp/emacs-lisp/easy-mmode.el (easy-mmode-defmap): Make obsolete. * lisp/progmodes/gud.el (gud-menu-map): Use easy-menu-define.
* ; Fix typos.Mattias EngdegÄrd2022-07-02
|
* Merge from origin/emacs-28Stefan Kangas2022-06-19
|\ | | | | | | 422f958030 Fix invalid defcustom :group when :predicate is used
| * Fix invalid defcustom :group when :predicate is usedRichard Hansen2022-06-18
| | | | | | | | | | | | * lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Fix invalid `:group' argument for the `-modes' defcustom that is created when `:predicate' is used (bug#56049).
* | Move buffer-local-set-state to subr because it's used at runtimeLars Ingebrigtsen2022-05-06
| | | | | | | | | | | | * lisp/subr.el (buffer-local-set-state) (buffer-local-set-state--get, buffer-local-restore-state): Moved from easy-mmode.el because they have to be available run-time.
* | ; Improve documentation of 'buffer-local-set-state'Eli Zaretskii2022-05-06
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/easy-mmode.el (buffer-local-set-state) (buffer-local-restore-state): Doc fixes. * doc/lispref/modes.texi (Defining Minor Modes): Fix a typo and improve wording and indexing.
* | Autoload the buffer-local-set* thingsLars Ingebrigtsen2022-05-06
| | | | | | | | | | | | * lisp/emacs-lisp/easy-mmode.el (buffer-local-set-state--get) (buffer-local-restore-state): Autoload. Perhaps it would be better to move these functions to subr.el or something...
* | Add new helper macros for minor modes to restore variablesLars Ingebrigtsen2022-05-06
| | | | | | | | | | | | | | | | | | | | | | * doc/lispref/modes.texi (Defining Minor Modes): Document it. * lisp/emacs-lisp/easy-mmode.el (buffer-local-set-state): New macro. (buffer-local-set-state--get): Helper function. (buffer-local-restore-state): New function. * lisp/textmodes/word-wrap-mode.el (word-wrap-whitespace-mode): Use it to simplify code.
* | Fix minor-mode doc string quotingLars Ingebrigtsen2022-04-06
| | | | | | | | | | | | * lisp/emacs-lisp/easy-mmode.el (easy-mmode--mode-docstring): Fix double quoting of things like (default-value 'electric-pair-mode) (bug#54746).
* | Have global minor modes say so in the doc stringLars Ingebrigtsen2022-04-03
| | | | | | | | | | | | | | * lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring): Allow saying whether it's a global minor mode or not. (easy-mmode--mode-docstring): Use it. (define-minor-mode): Pass in the data.
* | Fix bootstrap errors after previous easy-mmode changeLars Ingebrigtsen2022-04-02
| | | | | | | | | | | | | | | | * lisp/subr.el (ensure-empty-lines, string-lines): Moved from subr-x so that they can be used in early bootstrap files. * lisp/emacs-lisp/easy-mmode.el (easy-mmode--mode-docstring): Don't use string-empty-p because of bootstrap issues.
* | Put the define-minor-mode boilerplate at the end of the doc stringsLars Ingebrigtsen2022-04-02
| | | | | | | | | | * lisp/emacs-lisp/easy-mmode.el (easy-mmode--mode-docstring): Put the boilerplate at the end of the doc string.
* | (macroexp-warn-and-return): Fix bug#53618Stefan Monnier2022-02-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/macroexp.el (macroexp-warn-and-return): Reorder arguments to preserve compatibility with that of Emacs-28. (macroexp--unfold-lambda, macroexp--expand-all): * lisp/emacs-lisp/pcase.el (pcase-compile-patterns, pcase--u1): * lisp/emacs-lisp/gv.el (gv-ref): * lisp/emacs-lisp/eieio.el (defclass): * lisp/emacs-lisp/eieio-core.el (eieio-oref, eieio-oref-default) (eieio-oset-default): * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): * lisp/emacs-lisp/cl-macs.el (cl-symbol-macrolet, cl-defstruct): * lisp/emacs-lisp/cl-generic.el (cl-defmethod): * lisp/emacs-lisp/byte-run.el (defmacro, defun): * lisp/emacs-lisp/bindat.el (bindat--type): Adjust accordingly.
* | Merge branch 'master' into scratch/correct-warning-posAlan Mackenzie2022-01-14
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge branch: commit d29291d665e808307126bf52c3e748fef78f0f9c (HEAD -> master, origin/master, origin/HEAD) Author: Stefan Monnier <monnier@iro.umontreal.ca> Date: Fri Jan 14 12:26:30 2022 -0500 (macroexp--expand-all): Fix bug#53227 and bug#46636
| * | Prefer defvar-keymap to easy-mmode-defmapStefan Kangas2022-01-13
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/gud.el (gud-minibuffer-local-map): * lisp/vc/pcvs-info.el (cvs-status-map): Use defvar-keymap. * lisp/emacs-lisp/easy-mmode.el (easy-mmode-defmap): Document as deprecated.
* | | Merge branch 'master' into scratch/correct-warning-posAlan Mackenzie2022-01-11
|\| |
| * | Add doc-string indices to easy-mmode-{defmap,defsyntax}Ivan Sokolov2022-01-09
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/easy-mmode.el (easy-mmode-defmap) (easy-mmode-defsyntax): Declare third argument as doc-string. (Bug#52978)
| * | Merge from origin/emacs-28Eli Zaretskii2022-01-01
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year. 86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year ebe8772f65 ; Minor fixes related to copyright years 23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye... 8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t. 19dcb237b5 ; Add 2022 to copyright years. # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex # lib/cdefs.h # lisp/erc/erc-dcc.el # lisp/erc/erc-imenu.el # lisp/erc/erc-replace.el # lisp/image-dired.el # lisp/progmodes/xref.el # m4/alloca.m4 # m4/byteswap.m4 # m4/errno_h.m4 # m4/getopt.m4 # m4/gnulib-common.m4 # m4/inttypes.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/sys_socket_h.m4
| | * ; Add 2022 to copyright years.Eli Zaretskii2022-01-01
| | |
* | | Several amendments to scratch/correct-warning-pos.Alan Mackenzie2021-12-01
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The position return by read-positioning-symbols is now the position in the buffer, rather than the offset from the start of a form, enabling warning positions in other parts of the buffer to be output. * src/lisp.h (lisp_h_EQ): Add XLI casts so that it compiles cleanly. * src/data.c (Fremove_pos_from_symbol): New DEFUN. * src/lread.c (readchar_count): renamed to readchar_offset. (read_internal_start) Initialize readchar_offset to the buffer's point when STREAM is a buffer. * lisp/emacs-lisp/bytecomp.el (byte-compile-warning-prefix): Amend to use OFFSET as a buffer position, not an offset from the start of a form. (byte-compile-warn): Remove symbol positions from any shape of ARGS, not just a symbol with position. * lisp/emacs-lisp/cconv.c (cconv-convert): In the :unused case, position the new IGNORE symbol with the VAR it has replaced. * lisp/emacs-lisp/macroexp.el (macroexp--warn-wrap, macroexp-warn-and-return): Add an extra position parameter to each. * lisp/emacs-lisp/bindat.el (bindat-type), lisp/emacs-lisp/byte-run.el (defmacro, defun), lisp/emacs-lisp/cconv.el (cconv--convert-func-body) (cconv-convert), lisp/emacs-lisp/cl-generic.el (cl-defmethod), lisp/emacs-lisp/cl-macs.el (cl-symbol-macrolet, cl-defstruct), lisp/emacs-lisp/easy-mmode.el (define-minor-mode), lisp/emacs-lisp/eieio-core.el (eieio-oref, eieio-oref-default) (eieio-oset-default), lisp/emacs-lisp/eieio.el (defclass), lisp/emacs-lisp/gv.el (gv-ref), lisp/emacs-lisp/macroexp.el (macroexp-macroexpand, macroexp--unfold-lambda, macroexp--expand-all), lisp/emacs-lisp/pcase.el (pcase-compile-patterns, pcase--u1): Add an extra position argument to each call of macroexp-warn-and-return.
* / Mark def* macros for indentationLars Ingebrigtsen2021-10-13
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/widget.el (define-widget-keywords): * lisp/vc/pcvs.el (defun-cvs-mode): * lisp/subr.el (defvar-local): (defvar-keymap): * lisp/skeleton.el (define-skeleton): * lisp/simple.el (define-alternatives): * lisp/progmodes/gud.el (gdb-script-mode): * lisp/progmodes/gdb-mi.el (def-gdb-preempt-display-buffer): (def-gdb-auto-update-trigger): (def-gdb-auto-update-handler): (def-gdb-trigger-and-handler): (def-gdb-thread-buffer-command): (def-gdb-thread-buffer-simple-command): (def-gdb-thread-buffer-gud-command): (def-gdb-set-positive-number): (def-gdb-memory-format): (def-gdb-memory-unit): (def-gdb-memory-show-page): * lisp/progmodes/compile.el (define-compilation-mode): * lisp/progmodes/cc-vars.el (defcustom-c-stylevar): * lisp/obsolete/cl.el (define-setf-expander): (defsetf): (define-modify-macro): * lisp/obsolete/cl-compat.el (defkeyword): * lisp/net/hmac-def.el (define-hmac-function): * lisp/international/mule-conf.el (define-iso-single-byte-charset): * lisp/international/ccl.el (define-ccl-program): * lisp/image.el (defimage): * lisp/gnus/gmm-utils.el (defun-gmm): * lisp/ezimage.el (defezimage): * lisp/erc/erc.el (define-erc-module): * lisp/emacs-lisp/shortdoc.el (define-short-documentation-group): * lisp/emacs-lisp/eieio.el (defclass): * lisp/emacs-lisp/eieio-compat.el (defgeneric): (defmethod): * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): (define-globalized-minor-mode): * lisp/emacs-lisp/derived.el (define-derived-mode): * lisp/emacs-lisp/byte-run.el (defsubst): (define-obsolete-function-alias): (define-obsolete-variable-alias): * lisp/custom.el (defcustom): (defface): (defgroup): (deftheme): * lisp/cedet/semantic/wisent.el (define-wisent-lexer): * lisp/cedet/semantic/lex.el (define-lex): (define-lex-analyzer): (define-lex-regex-analyzer): (define-lex-simple-regex-analyzer): (define-lex-block-analyzer): (define-lex-keyword-type-analyzer): (define-lex-sexp-type-analyzer): (define-lex-regex-type-analyzer): (define-lex-string-type-analyzer): (define-lex-block-type-analyzer): * lisp/cedet/semantic/lex-spp.el (define-lex-spp-macro-declaration-analyzer): (define-lex-spp-macro-undeclaration-analyzer): (define-lex-spp-include-analyzer): * lisp/cedet/semantic/dep.el (defcustom-mode-local-semantic-dependency-system-include-path): * lisp/cedet/semantic/decorate/mode.el (define-semantic-decoration-style): * lisp/cedet/mode-local.el (define-child-mode): (define-overloadable-function): (define-mode-local-override): * lisp/calc/calc.el (defcalcmodevar): (defmath): Explicitly mark all macros that have names that start with "def" that should indent defunly-like (bug#43329).
* Fix substitution of pretty quotes in code in easy-mmodeLars Ingebrigtsen2021-10-03
| | | | | | * lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring): Adjust. (easy-mmode--mode-docstring): Avoid making quotes into pretty quotes in code (bug#50968).
* Signal error on newline in internal--format-docstring-lineStefan Kangas2021-09-28
| | | | | | | | | | * lisp/subr.el (internal--format-docstring-line): Signal error when trying to fill a line containing a newline. * lisp/cedet/semantic/decorate/mode.el (define-semantic-decoration-style): * lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Don't pass newlines to 'internal--format-docstring-line'.
* Minor clarification of define-minor-mode :keymap argumentStefan Kangas2021-09-25
| | | | | | * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Minor doc fix; clarify by saying that ":keymap" should be an "unquoted variable name". (Bug#25505)
* ; More minor docfixes found by checkdocStefan Kangas2021-09-14
|
* Minor clarification for define-minor-mode :variableLars Ingebrigtsen2021-08-16
| | | | | | * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): * doc/lispref/modes.texi (Defining Minor Modes): Clarify what the setter function should do (bug#14875).
* Improve `define-globalized-minor-mode' doc stringsLars Ingebrigtsen2021-08-04
| | | | | * lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Copy the description from easy-mmode--arg-docstring (bug#49843).
* Revert "Allow nil initializers in define-minor-mode"Lars Ingebrigtsen2021-07-31
| | | | | | This reverts commit 02cbb37de73d563149389615ee44741322007108. This was mistakenly commited and doesn't really make much sense.
* Allow nil initializers in define-minor-modeLars Ingebrigtsen2021-07-31
| | | | | * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Make the meaning of :initialize nil and a missing :initialize the same.
* Make the minor mode doc strings say that they're minor modesLars Ingebrigtsen2021-06-30
| | | | | * lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring): Mention that this is a minor mode (bug#20462).
* Make minor mode docstrings say what the mode "variable" isLars Ingebrigtsen2021-06-22
| | | | | | | * lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring): Add the mode variable (bug#36500). (easy-mmode--mode-docstring): (define-minor-mode): Pass in the getter.
* * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Fix bug#47925Stefan Monnier2021-04-20
| | | | | | In order to correctly detect the case of the "new style" with an empty body, remove the old optional arguments `init-value`, `lighter`, and `keymap`, so we can distinguish the "nil arg" from the "absent arg" cases.
* * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Tweak furtherStefan Monnier2021-04-17
| | | | Suggested by Lars Ingebrigtsen <larsi@gnus.org>.
* * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Improve `C-h f` outputStefan Monnier2021-04-16
| | | | Suggested by Michael Heerdegen <michael_heerdegen@web.de>.
* (define-minor-mode): Warn about use of pre-Emacs-21 style argsStefan Monnier2021-04-12
| | | | | | | | | * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Use `advertised-calling-convention` to avoid promoting the old style arguments. Emit a wanring when old-style arguments are used. Massage the docstring accordingly. * doc/lispref/modes.texi (Defining Minor Modes): Document the keyword arguments rather than the old-style positional arguments.
* Make byte-compiled uses of `define-minor-mode' more compatibleLars Ingebrigtsen2021-03-12
| | | | | * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Be more defensive about accessing minor mode variables.
* Add a new variable `global-minor-modes'Lars Ingebrigtsen2021-02-15
| | | | | | | | | * 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.
* Rename minor-modes to local-minor-modesLars Ingebrigtsen2021-02-15
| | | | | | | | | | | | | | | * 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.
* Don't update `minor-modes' in global modesLars Ingebrigtsen2021-02-14
| | | | | * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): There's no point in setting the buffer-local `minor-modes' in global modes.
* Really fix the syntax problem in define-minor-modeLars Ingebrigtsen2021-02-14
| | | | | * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Fix interactive extension in previous change.