Posts

Showing posts with the label font-lock

GNU Emacs as a lightweight IDE

Image
If you have a small project in any of the supported languages, you can get IDE like features without any additional installation in Emacs. Given the CEDET framework, supporting more languages boils down to simply adding a new grammar and overloading few functions. Presently, it works for the following languages (demo links in brackets): - C ( Auto-suggest data structure , Auto-suggest basic , generate header ) - LaTex ( Auto-suggest ) - SQL ( Auto-suggest from connected DB , Auto-suggest local names and statements ) - HTML, JS , CSS - Java ( Auto-suggest , Refactoring , Debugging , Type hierarchy , Semantic font-lock , Getter/setter ) - Elisp ( Auto-suggest , Refactoring ) - PHP - Assembly   - IDE Basics , Outline view , Rename symbol , Lexer based indent region , Call tree, Semantic font lock Complete playlist is here .   Steps Build Emacs from source  https://gitlab.com/atamariya/emacs/tree/dev You should put the following in your .emacs file.  Co...

Semantic font-lock for Java in Emacs

Image
I've been working on Semantic font-lock for Java using CEDET Semantic infrastructure which uses Wisent incremental parsing under the hood. Also it only highlights the visible text on the screen to keep the delays acceptable. So far the results look promising. Builtin font-lock uses jit-lock infrastructure. cc-mode provides the keywords and regexes for language specific highlighting. However, this lacks highlighting using any contextual information. Demo: https://youtu.be/4UcPIdTJLOM Noticeable features: Static variables and functions are highlighted differently. Constant variables are highlighted differently. Not only the declaration, but the usages are highlighted also. Package is highlighted correctly. It uses following face definitions for highlighting. (defvar semantic-format-face-alist `( (function . font-lock-function-name-face) (variable . font-lock-variable-name-face) (type . font-lock-type-face) ;; These are differe...