Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 346653

Summary: app-emacs/ebuild-mode: highlight /etc/portage/make.conf better
Product: Gentoo Linux Reporter: Yu Yuwei <acevery>
Component: Current packagesAssignee: Emacs project <emacs>
Status: CONFIRMED ---    
Severity: enhancement CC: sam
Priority: Normal Keywords: NeedPatch
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Yu Yuwei 2010-11-24 14:04:22 UTC
I shifted from vim recently, and wish app-emacs/gentoo-syntax can provide better syntax-highlight for the USE flags in /etc/make.conf.

For example:
USE="emacs -vim"
The "emacs" in blue color and "-vim" in red color, or some other colors.

Thanks!

Reproducible: Always
Comment 1 Ulrich Müller gentoo-dev 2011-01-29 10:21:46 UTC
I haven't found time for this yet, and most probably won't in the next future.

Patches are welcome.
Comment 2 Ulrich Müller gentoo-dev 2023-08-31 13:29:32 UTC
Emacs doesn't use ebuild-mode for make.conf, but conf-unix-mode. For the requested highlighting, one would have to add "USE=" and the flag syntax to the font-lock keywords of that mode (or a mode derived from it), most likely something of the form "(matcher . anchored-highlighter)". See the Elisp Reference Manual:
https://www.gnu.org/software/emacs/manual/html_node/elisp/Search_002dbased-Fontification.html

A complication is that a variable assignment in make.conf can span multiple lines, therefore the standard line-based approach won't work. A possible solution to this is outlined here:
https://www.gnu.org/software/emacs/manual/html_node/elisp/Multiline-Font-Lock.html

Also, comment #1 still applies.