From: Stefan Monnier Date: Sun, 22 May 2022 15:22:29 +0000 (-0400) Subject: bovine/grammar.el: Prefer `define-mode-local-override` X-Git-Tag: emacs-29.0.90~1910^2~518 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=35afd1f246cf2c56dd88ea56c8960fcf49d3a7c7;p=emacs.git bovine/grammar.el: Prefer `define-mode-local-override` * lisp/cedet/semantic/bovine/grammar.el (semantic-grammar-parsetable-builder, semantic-grammar-setupcode-builder): Override with `define-mode-local-override`. (bovine-grammar-mode): Don't override them with `semantic-install-function-overrides`. --- diff --git a/lisp/cedet/semantic/bovine/grammar.el b/lisp/cedet/semantic/bovine/grammar.el index d478b12f645..67366ad445e 100644 --- a/lisp/cedet/semantic/bovine/grammar.el +++ b/lisp/cedet/semantic/bovine/grammar.el @@ -260,7 +260,8 @@ QUOTEMODE is the mode in which quoted symbols are slurred." (insert ")\n"))) ) -(defun bovine-grammar-parsetable-builder () +(define-mode-local-override semantic-grammar-parsetable-builder + bovine-grammar-mode () "Return the parser table expression as a string value. The format of a bovine parser table is: @@ -409,7 +410,8 @@ The source directory is relative to some root in the load path." newdir)) (error (buffer-name)))) -(defun bovine-grammar-setupcode-builder () +(define-mode-local-override semantic-grammar-setupcode-builder + bovine-grammar-mode () "Return the text of the setup code." (format "(setq semantic--parse-table %s\n\ @@ -435,10 +437,7 @@ Menu items are appended to the common grammar menu.") ;;;###autoload (define-derived-mode bovine-grammar-mode semantic-grammar-mode "BY" "Major mode for editing Bovine grammars." - (semantic-grammar-setup-menu bovine-grammar-menu) - (semantic-install-function-overrides - '((semantic-grammar-parsetable-builder . bovine-grammar-parsetable-builder) - (semantic-grammar-setupcode-builder . bovine-grammar-setupcode-builder)))) + (semantic-grammar-setup-menu bovine-grammar-menu)) (add-to-list 'auto-mode-alist '("\\.by\\'" . bovine-grammar-mode)) @@ -461,7 +460,7 @@ Menu items are appended to the common grammar menu.") (defun bovine--make-parser-1 (infile &optional outdir) (if outdir (setq outdir (file-name-directory (expand-file-name outdir)))) ;; It would be nicer to use a temp-buffer rather than find-file-noselect. - ;; The only thing stopping us is bovine-grammar-setupcode-builder's + ;; The only thing stopping us is bovine's semantic-grammar-setupcode-builder's ;; use of (buffer-name). Perhaps that could be changed to ;; (file-name-nondirectory (buffer-file-name)) ? ;; (with-temp-buffer diff --git a/lisp/cedet/semantic/texi.el b/lisp/cedet/semantic/texi.el index 9b8dfef5f36..d005b7a854c 100644 --- a/lisp/cedet/semantic/texi.el +++ b/lisp/cedet/semantic/texi.el @@ -61,10 +61,7 @@ IGNORE any arguments, always parse the whole buffer. Each tag returned is of the form: (\"NAME\" section (:members CHILDREN)) or - (\"NAME\" def) - -It is an override of `semantic-parse-region' and must be installed by the -function `semantic-install-function-overrides'." + (\"NAME\" def)" (mapcar #'semantic-texi-expand-tag (semantic-texi-parse-headings)))