From: Stefan Monnier Date: Sun, 22 May 2022 16:13:28 +0000 (-0400) Subject: wisent/grammar.el: Prefer `define-mode-local-override` X-Git-Tag: emacs-29.0.90~1910^2~516 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a1a6e6c5c44e0930784de67fc6b25c3cc43e0ee4;p=emacs.git wisent/grammar.el: Prefer `define-mode-local-override` * lisp/cedet/semantic/wisent/grammar.el (semantic-grammar-parsetable-builder, semantic-grammar-setupcode-builder): Override with `define-mode-local-override`. (wisent-grammar-mode): Don't override them with `semantic-install-function-overrides`. --- diff --git a/lisp/cedet/semantic/wisent/grammar.el b/lisp/cedet/semantic/wisent/grammar.el index 5ca22bac86c..a4104e333d3 100644 --- a/lisp/cedet/semantic/wisent/grammar.el +++ b/lisp/cedet/semantic/wisent/grammar.el @@ -284,13 +284,15 @@ Return the expanded expression." (assocs (wisent-grammar-assocs))) (cons terminals (cons assocs nonterminals)))) -(defun wisent-grammar-parsetable-builder () +(define-mode-local-override semantic-grammar-parsetable-builder + wisent-grammar-mode () "Return the value of the parser table." `(wisent-compiled-grammar ,(wisent-grammar-grammar) ,(semantic-grammar-start))) -(defun wisent-grammar-setupcode-builder () +(define-mode-local-override semantic-grammar-setupcode-builder + wisent-grammar-mode () "Return the parser setup code." (format "(semantic-install-function-overrides\n\ @@ -322,10 +324,7 @@ Menu items are appended to the common grammar menu.") (define-derived-mode wisent-grammar-mode semantic-grammar-mode "WY" "Major mode for editing Wisent grammars." (semantic-grammar-setup-menu wisent-grammar-menu) - (setq-local semantic-grammar-require-form '(require 'semantic/wisent)) - (semantic-install-function-overrides - '((semantic-grammar-parsetable-builder . wisent-grammar-parsetable-builder) - (semantic-grammar-setupcode-builder . wisent-grammar-setupcode-builder)))) + (setq-local semantic-grammar-require-form '(require 'semantic/wisent))) (defvar-mode-local wisent-grammar-mode semantic-grammar-macros '(