]> git.eshelyaron.com Git - emacs.git/commitdiff
wisent/grammar.el: Prefer `define-mode-local-override`
authorStefan Monnier <monnier@iro.umontreal.ca>
Sun, 22 May 2022 16:13:28 +0000 (12:13 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sun, 22 May 2022 16:17:45 +0000 (12:17 -0400)
* 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`.

lisp/cedet/semantic/wisent/grammar.el

index 5ca22bac86c2f91ecc3659fdea0757c001d60340..a4104e333d38c1fff9a21ceab019c2fa686c0ab9 100644 (file)
@@ -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
   '(