Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support modelines #226

Open
mcandre opened this issue May 3, 2023 · 2 comments
Open

support modelines #226

mcandre opened this issue May 3, 2023 · 2 comments

Comments

@mcandre
Copy link
Owner

mcandre commented May 3, 2023

For identifying and skipping implementation-specific makefiles.

Emacs file local variable:

# -*- mode: <language> -*-

where <language> is a make language variant, such as make, gmake, bmake, nmake, etc.

Vim modeline:

# vim: ft=<language>:

We should confirm the exact language names in both Vim and Emacs, in case they require subtly different names for the various make implementations.

Vim users also apply instead the bindings syntax or filetype.

See also the polyglot forms:

# -*- mode: <language>; -*-
# vim: set syntax=language:
# -*- mode: <language>; -*- vim: set ft=<language>:

https://marketplace.visualstudio.com/items?itemName=chrislajoie.vscode-modelines

We should warn to encourage this mode line in *.include.mk files.

We should document in the parsing guide that mode lines are good to use, especially for makefiles using non-POSIX extensions.

@mcandre
Copy link
Owner Author

mcandre commented May 3, 2023

Pending ctlajoie/vscode-modelines@8a6db4d

@mcandre
Copy link
Owner Author

mcandre commented May 3, 2023

Oh wow, POSIX vi dropped support for modelines.

All the more reason to use ft rather than syntax in Vim and Emacs modelines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant