Skip to content

Move swiftpm-project-settings.el settings to .dir-locals.el #7314

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

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

judemille
Copy link
Contributor

Directory-local variables have been moved so that they are set directly
in .dir-locals.el.

Motivation:

The variables set in swiftpm-project-settings.el can be set directly
in dir-locals.el. There is no reason to move them to a separate file,
and in fact doing that will automatically make Emacs flag the dir-locals
as unsafe, since it will be being requested to evaluate a block of code,
instead of setting known-safe variables.

Modifications:

Utilities/Emacs/swiftpm-project-settings.el has been removed. All variables
set in it have been moved to .dir-locals.el itself. This allows the evaluation
of all directory locals to be considered safe.

Additionally, swift-basic-offset was changed to swift-mode:basic-offset.
That appears to be the proper variable for setting indent width for Swift in Emacs.

Result:

Emacs users can edit the project more peacefully.

The variables set in `swiftpm-project-settings.el` can be set directly
in `dir-locals.el`. There is no reason to move them to a separate file,
and in fact doing that will automatically make Emacs flag the dir-locals
as unsafe, since it will be being requested to evaluate a block of code,
instead of setting known-safe variables.

Signed-off-by: Julia DeMille <[email protected]>
@MaxDesiatov
Copy link
Contributor

@swift-ci test

@MaxDesiatov MaxDesiatov changed the title Make .dir-locals.el sensible Move swiftpm-project-settings.el settings to .dir-locals.el Feb 5, 2024
@MaxDesiatov MaxDesiatov disabled auto-merge February 5, 2024 14:59
@MaxDesiatov MaxDesiatov enabled auto-merge (squash) February 5, 2024 14:59
@MaxDesiatov MaxDesiatov merged commit e10ff90 into swiftlang:main Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants