emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Multi-mode editing with semantic


From: Anand Tamariya
Subject: Multi-mode editing with semantic
Date: Tue, 10 Mar 2020 13:56:32 +0700

Hi,
Glad to announce my enhancements to semantic which allows multi-mode editing in a single buffer. Demo video demonstrates the same for HTML with CSS and JS sections and includes. Jump to definition shortcut works for includes and definitions. JS and HTML uses company-semantic backend for auto-suggest whereas CSS uses company-capf. JS uses wisent based parsing, HTML uses libxml based parsing and CSS uses regex based parsing.

https://youtu.be/FkOYUPjdID8

Usage
- Define a pre-command hook in major-mode
(add-hook 'pre-command-hook #'(lambda()
                                  (setq mode-local-active-mode
                                        (semantic-get-cache-data 'mode (point)))
                                  (activate-mode-local-bindings))
            -1 t)

- Mark sections using (semantic-cache-data-to-buffer) while parsing major mode.
- Collect tags using (semantic-parse-region start end)
- Override (semantic-ctxt-current-class-list) to return tag class allowed at a point

Regards,
Anand

reply via email to

[Prev in Thread] Current Thread [Next in Thread]