aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emacs-lisp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ; elisp-scope.el: Standardize copyright notice.Eshel Yaron2025-10-161-4/+6
| | | | Suggested by Arash Esbati <arash@gnu.org>.
* ; elisp-scope.el: Rename some private symbols as suchEshel Yaron2025-10-151-337/+363
| | | | | | | | | | | | | | | | Also add a few missing docstrings. * lisp/emacs-lisp/elisp-scope.el (elisp-scope-symbol-role-p) (elisp-scope-read-symbol-role, elisp-scope-special-variables) (elisp-scope-let, elisp-scope-let*): Add docstring. (elisp-scope-counter, elisp-scope-callback) (elisp-scope-current-let-alist-form, elisp-scope-local-new) (elisp-scope-sym-pos, elisp-scope-sym-bare) (elisp-scope-report, elisp-scope-special-variable-p) (elisp-scope-let-1, elisp-scope-variable) (elisp-scope-binding, elisp-scope-symbol): Rename, replace 'elisp-scope-' prefix with 'elisp-scope--' to indicate that these are private. Update all references.
* (rx): Remove the `rx--pcase-expand` middle manStefan Monnier2025-10-141-7/+1
| | | | | * lisp/emacs-lisp/rx.el (rx): Remove the `rx--pcase-expand` middle man, now that `loaddefs-gen.el` expands the `pcase-defmacro` for us.
* (define-minor-mode): Update `global-minor-modes` if init-value is non-nilStefan Monnier2025-10-141-29/+24
| | | | | | | | | | | | | | | | When a global minor mode is enabled by init-value rather than by calling the major mode function, we failed to register it in `global-minor-modes` (bug#79518). * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Register ourselves in `global-minor-modes` at top-level for global modes with a non-nil init-value. Also in the `modefun`, simply the code with `not` and `add-to-list` and consolidate the local/global paths to update `*-minor-modes`. * lisp/simple.el (global-minor-modes): Move to... * lisp/subr.el (global-minor-modes): ...here so it's defined early enough for `auto-compression-mode` to register itself.
* ; Fix recently introduced uses of "ELisp".Sean Whitton2025-10-131-6/+6
|
* ; Improve documentation of semantic highlightingEli Zaretskii2025-10-131-38/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/elisp-mode.el (elisp) (elisp-fontify-semantically, elisp-symbol-at-mouse) (elisp-free-variable, elisp-special-variable-declaration) (elisp-condition, elisp-major-mode-name, elisp-face) (elisp-symbol-role, elisp-symbol-role-definition) (elisp-function, elisp-non-local-exit, elisp-unknown-call) (elisp-macro, elisp-special-form, elisp-throw-tag) (elisp-feature, elisp-rx, elisp-theme, elisp-binding-variable) (elisp-bound-variable, elisp-shadowing-variable) (elisp-shadowed-variable, elisp-variable-at-point) (elisp-warning-type, elisp-function-property-declaration) (elisp-thing, elisp-slot, elisp-widget-type, elisp-type) (elisp-group, elisp-nnoo-backend, elisp-ampersand) (elisp-constant, elisp-defun, elisp-defmacro, elisp-defvar) (elisp-defface, elisp-icon, elisp-deficon, elisp-oclosure) (elisp-defoclosure, elisp-coding, elisp-defcoding) (elisp-charset, elisp-defcharset, elisp-completion-category) (elisp-completion-category-definition, elisp-add-help-echo) (elisp-fontify-symbol-precedence-function): Add :version tags. * lisp/emacs-lisp/elisp-scope.el: Fix references to meta-syntactic variables in the commentary. (elisp-scope-describe-symbol-role, coding, defcoding, charset) (defcharset): Doc fixes. (elisp-scope-safe-macros): Add :version tag. Doc fix. * doc/emacs/display.texi (Semantic Font Lock): Fix punctuation and wording, improve cross-references and indexing.
* Merge branch 'feature/elisp-fontify-semantically'Eshel Yaron2025-10-121-0/+2942
|\
| * ; elisp-scope.el: Improve customization group name handling.Eshel Yaron2025-10-121-10/+2
| | | | | | | | | | | | * lisp/emacs-lisp/elisp-scope.el (elisp-scope-quoted-group): Delete it. (define-minor-mode, define-derived-mode): Simplify analyzers.
| * ; elisp-scope.el: Improve widget-type handling.Eshel Yaron2025-10-121-80/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use argument specs to analyze complex widget types. * lisp/emacs-lisp/elisp-scope.el (elisp-scope-widget-type) (elisp-scope-widget-type-1) (elisp-scope-widget-type-keyword-arguments) (elisp-scope-widget-type-arguments) (elisp-scope-widget-type-arguments-1): Delete, no longer used. (custom-declare-variable, define-widget): Simplify analyzers. (elisp-scope--match-spec-to-arg): Add new 'list', 'and', and 'plist-and-then' parametric specs, and add 'widget-type' as a new recursive spec. * test/lisp/progmodes/elisp-mode-resources/semantic-highlighting.el Add test.
| * ; elisp-mode.el: Improve consistency among face names.feature/elisp-fontify-semanticallyEshel Yaron2025-10-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename a couple of faces to solidify the convention that the face name 'elisp-foo' implies "references to foo", not "foo definitions". For definitions we use 'elisp-deffoo' if foo is only one word, or 'elisp-bar-baz-definition' otherwise. * lisp/progmodes/elisp-mode.el (elisp-function-reference): Rename to 'elisp-function'. (elisp-macro-call): Rename to 'elisp-macro'. (elisp-non-local-exit): (elisp-unknown-call): (elisp-special-form): * lisp/emacs-lisp/elisp-scope.el: * test/lisp/progmodes/elisp-mode-resources/semantic-highlighting.el: Update references to renamed faces.
| * ; elisp-scope.el: Clean up symbol role definitions.Eshel Yaron2025-10-121-126/+61
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/elisp-mode.el (elisp-fontify-semantically): Fix typo in doc string. (elisp--annotate-symbol-with-help-echo): Accept plain string as value of ':help' symbol role property. * lisp/emacs-lisp/elisp-scope.el: Remove unused symbol role properties from all defined symbol roles. Use plain strings for ':help' instead of wrapping them with 'cl-constantly'. Cease 'require'ing 'cl-lib', no longer needed in runtime. (elisp-scope-define-symbol-role): Update doc string.
| * Document 'elisp-fontify-semantically' in the Emacs manualEshel Yaron2025-10-111-3/+107
| | | | | | | | | | | | | | | | * doc/emacs/display.texi (Semantic Font Lock): New node. * doc/emacs/emacs.texi: Update menu. * etc/NEWS: Update relevant entry. * lisp/emacs-lisp/elisp-scope.el: Expand commentary. * doc/misc/elisp-semantic-highlighting.org: Delete it.
| * ; (elisp-scope-if-let): Fix case where bindings entry is a symbolEshel Yaron2025-10-081-5/+9
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/elisp-scope.el (elisp-scope-if-let): Fix handling of a plain symbol as one the bindings in an 'if-let*' form, as in (if-let* (foo) 'bar). * test/lisp/progmodes/elisp-mode-resources/semantic-highlighting.el: Test it.
| * ; * lisp/emacs-lisp/elisp-scope.el (if-let*): Add comment.Eshel Yaron2025-10-081-0/+6
| |
| * ; elisp-scope.el: Fix 'wrong-type-argument' in local function analyzersEshel Yaron2025-10-081-12/+15
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/elisp-scope.el (elisp-scope--local-function-analyzer): New function. (elisp-scope-flet, elisp-scope-labels) (elisp-scope-named-let): Use it. (elisp-scope-cl-macrolet): Check that argument is 'symbol-with-pos-p' before calling 'symbol-with-pos-pos'.
| * ; elisp-scope.el: Fix handling of 'if-let' and friendsEshel Yaron2025-10-071-0/+18
| | | | | | | | | | * lisp/emacs-lisp/elisp-scope.el (elisp-scope-if-let): New function, used to analyze 'if-let*' forms.
| * ; Rename 'elisp-scope--local' to 'elisp-scope-local-bindings'Eshel Yaron2025-10-061-63/+70
| | | | | | | | | | We make this variable "public" since it's part of the interface that we expose to custom analyzers.
| * ; Drop 'elisp-scope-local-functions'Eshel Yaron2025-10-061-5/+2
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/elisp-scope.el (elisp-scope-local-functions): Remove it, superseded by 'elisp-scope-local-definitions'. (elisp-scope-sharpquote, elisp-scope-1): Update accordingly. (elisp-scope-analyze-form): Fix typo in docstring.
| * ; elisp-scope.el: Drop special-form special handlingEshel Yaron2025-10-061-1/+4
| | | | | | | | | | | | * lisp/emacs-lisp/elisp-scope.el (elisp-scope-1): All special-forms should have an associated analyzer, so drop fallback handling for unknown special-forms.
| * ; Test semantic highlighting with 'cl-macrolet' and 'cl-flet'Eshel Yaron2025-10-061-0/+2
| |
| * elisp-scope.el: Unify and generalize local function/macro handlingEshel Yaron2025-10-061-37/+49
| | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/elisp-scope.el (elisp-scope-local-definitions): New variable. Replaces... (elisp-scope-flet-alist, elisp-scope-macrolet-alist): these. Removed, no longer used. (elisp-scope-1, elisp-scope--handle-quoted): Update. (elisp-scope-with-local-definition): New macro. (elisp-scope-flet, elisp-scope-labels, elisp-scope-named-let) (elisp-scope-cl-macrolet): Use it.
| * ; elisp-scope.el: Thread output spec though more macro analyzersEshel Yaron2025-10-061-17/+14
| | | | | | | | | | | | * lisp/emacs-lisp/elisp-scope.el (elisp-scope-flet) (elisp-scope-labels, elisp-scope-cl-macrolet): Add argument 'outspec' and pass it down to 'elisp-scope-n'.
| * ; elisp-scope.el: Recognize special variable declarationsEshel Yaron2025-10-061-10/+15
| | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/elisp-scope.el (special-variable-declaration): New symbol role. (defvar): Update analyzer to distinguish between declarations and definitions. (defconst): Add a separate analyzer. * lisp/progmodes/elisp-mode.el (elisp-special-variable-declaration): New face.
| * ; (elisp-scope-define-special-form-analyzer): Fix typo.Eshel Yaron2025-10-031-1/+1
| |
| * ; (elisp-scope-describe-symbol-role): Minor clean up.Eshel Yaron2025-10-031-4/+0
| |
| * ; elisp-scope.el: Support hooking into `describe-symbol-backends'.Eshel Yaron2025-10-031-2/+12
| | | | | | | | | | | | | | * lisp/emacs-lisp/elisp-scope.el (elisp-scope-add-symbol-roles-to-describe-symbol): New autoloaded function intended for user configs, hooks `elisp-scope-describe-symbol-role' into `describe-symbol'.
| * ; (elisp-scope-1): Add a "TODO".Eshel Yaron2025-10-031-0/+2
| |
| * ; (elisp-scope-gen-id-alist): Remove, unused.Eshel Yaron2025-10-031-2/+0
| |
| * ; elisp-scope.el: Fix 'custom-declare-face' analyzer.Eshel Yaron2025-10-031-2/+3
| |
| * ; elisp-scope.el: Improve 'oclosure-define' 'slots' analysisEshel Yaron2025-10-031-1/+5
| |
| * ; Rename 'elisp-scope-output-type' to 'elisp-scope-output-spec'.Eshel Yaron2025-10-031-116/+116
| | | | | | | | | | * lisp/emacs-lisp/elisp-scope.el: Change all references to this notion of "type" to say "spec" instead.
| * ; elisp-scope.el: Improve 'defclass' slots analysis.Eshel Yaron2025-10-031-28/+56
| | | | | | | | | | | | | | | | | | | | Extend the "type" system (to be renamed to "spec" in subsequent commit) of elisp-scope.el with a plist spec. This allows us to define a spec for the 'slots' argument of 'eieio-defclass-internal'. Also add a 'cl-type' spec, describing the type specifications used by 'cl-typep', and replace the 'equal' spec with a more general 'member' spec, like we have in 'cl-typep'.
| * ; Rename 'elisp-scope--output-type' to make it publicEshel Yaron2025-10-021-30/+42
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/elisp-scope.el (elisp-scope--output-type): Add docstring and rename to... (elisp-scope-output-type): this. Update all references. * lisp/emacs-lisp/elisp-scope.el (elisp-scope-analyze-form): Add example 'elisp-scope-analyzer' to docstring.
| * ; (elisp-scope-1): Analyze macros with (debug t) as prognEshel Yaron2025-10-021-2/+2
| | | | | | | | | | | | | | | | Take an Edebug spec of t as an indication that all of the macro's arguments are evaluated, and analyze them as such. Only do so as a fallback for macros that we cannot expand, because expanding can lead to more accurate analysis, e.g. with regards to the output type of the form.
| * ; Expand ELisp semantic highlighting documentationEshel Yaron2025-10-021-6/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/elisp-scope.el (elisp-scope-get-symbol-role-property) (elisp-scope-set-symbol-role-property) (elisp-scope-safe-macro-p, elisp-scope-report-s) (elisp-scope-1, elisp-scope-n): Add docstring. (elisp-scope-analyze-form): * lisp/progmodes/elisp-mode.el (elisp-fontify-semantically): Expand docstring. * etc/NEWS: Refer to 'elisp-fontify-semantically' for documentation.
| * ; elisp-scope.el: Rename 'variable' role to 'free-variable'.Eshel Yaron2025-10-011-10/+13
| |
| * ; Fix recent small mistake in recent refactor.Eshel Yaron2025-10-011-2/+2
| |
| * ; elisp-scope.el: Simplify 'eval' analyzer.Eshel Yaron2025-10-011-3/+6
| |
| * ; elisp-scope.el: Rename 'declaration' role.Eshel Yaron2025-10-011-5/+5
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/elisp-scope.el (declaration): Rename to 'function-property-declaration'. (elisp-scope-lambda): * lisp/progmodes/elisp-mode.el (elisp-function-property-declaration): Update accordingly.
| * ; elisp-scope.el: Remove unused 'undefined-macro' role.Eshel Yaron2025-10-011-4/+0
| |
| * ; elisp-scope.el: Fix 'define-completion-category' handler.Eshel Yaron2025-10-011-1/+1
| |
| * ; (elisp-scope-define-symbol-role): Add docstring.Eshel Yaron2025-10-011-0/+8
| |
| * ; Call it "symbol role" instead of "symbol type".Eshel Yaron2025-10-011-124/+124
| | | | | | | | | | | | | | | | | | | | Change the terminology used in elisp-scope.el to call the symbols we use to categorizes the use of (other) symbols "symbol roles" instead of "symbol types". * lisp/emacs-lisp/elisp-scope.el: * lisp/progmodes/elisp-mode.el: Change all occurrences of "symbol type" say "role" instead.
| * (elisp-scope-get-symbol-type-property): Revise inheritance handling.Eshel Yaron2025-10-011-19/+14
| |
| * ; (elisp-scope-define-symbol-type): Cease autoloading it.Eshel Yaron2025-09-301-1/+0
| |
| * ; elisp-scope.el: Update multiple function handlers.Eshel Yaron2025-09-301-211/+278
| | | | | | | | | | | | | | | | | | | | | | | | | | Update all remaining function handlers to use 'elisp-scope-define-func-analyzer' instead of 'elisp-scope-define-function-analyzer'. The difference is that the former handles all arguments explicitly, while the latter analyzes all arguments as evaluated forms automatically. By handling the arguments explicitly, we get a chance to specify the expected type of different arguments. Lastly, since 'elisp-scope-define-function-analyzer' is now unused, rename 'elisp-scope-define-func-analyzer' to 'elisp-scope-define-function-analyzer'.
| * ; Rename scope.el to elisp-scope.elEshel Yaron2025-09-292-2666/+2667
| | | | | | | | | | | | * scope.el: Rename it to... * elisp-scope: New file. * lisp/progmodes/elisp-mode.el: Update accordingly.
| * ; scope.el: Mark 'static-when/unless' as unsafe.Eshel Yaron2025-09-291-1/+8
| | | | | | | | | | | | * lisp/emacs-lisp/scope.el: Add handlers for 'static-when' and 'static-unless'. (scope-unsafe-macros): Also add them to list of unsafe macros.
| * Add optional semantic highlighting for Emacs Lisp.Eshel Yaron2025-09-291-0/+2659
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/scope.el: New file. * lisp/progmodes/elisp-mode.el (elisp): New 'defgroup'. (elisp-add-help-echo, elisp-fontify-semantically) (elisp-fontify-symbol-precedence-function): New options. (elisp-symbol-at-mouse, elisp-free-variable, elisp-condition) (elisp-major-mode-name, elisp-face, elisp-symbol-type) (elisp-symbol-type-definition, elisp-function-reference) (elisp-non-local-exit, elisp-unknown-call, elisp-macro-call) (elisp-special-form, elisp-throw-tag, elisp-feature) (elisp-rx, elisp-theme, elisp-binding-variable) (elisp-bound-variable, elisp-shadowing-variable) (elisp-shadowed-variable, elisp-variable-at-point) (elisp-warning-type, elisp-declaration, elisp-thing) (elisp-slot, elisp-widget-type, elisp-type, elisp-group) (elisp-nnoo-backend, elisp-ampersand, elisp-constant) (elisp-defun, elisp-defmacro, elisp-defvar, elisp-defface) (elisp-icon, elisp-deficon, elisp-oclosure) (elisp-defoclosure, elisp-coding, elisp-defcoding) (elisp-charset, elisp-defcharset, elisp-completion-category) (elisp-completion-category-definition): New faces. (elisp-local-references, elisp-highlight-variable) (elisp-unhighlight-variable, elisp-cursor-sensor) (elisp--function-help-echo, elisp--help-echo-1) (elisp--help-echo, elisp--annotate-symbol-with-help-echo) (elisp-extend-region-to-whole-defuns, elisp-fontify-symbol) (elisp-fontify-region-semantically, elisp-fontify-region): New functions. (emacs-lisp-mode): Set 'font-lock-extra-managed-props', 'font-lock-fontify-region-function' and 'font-lock-extend-region-functions'. * etc/NEWS: Announce new feature.
* | define-globalized-minor-mode: Fix multiple globalized modesSean Whitton2025-10-081-6/+17
| | | | | | | | | | | | * lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Suppress MODE-set-explicitly function when enabling the mode ourselves.