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

Remove .dir-locals.el #48157

Merged
merged 1 commit into from Oct 10, 2018
Merged

Conversation

ElvishJerricco
Copy link
Contributor

Motivation for this change

This file has been excruciatingly annoying to me. I don't personally want to save those dir-locals as trusted in my emacs config. So now every buffer I open prompts me "Do you really want to apply it?" This includes magit, which operates by opening buffers extremely frequently. Frankly, I think anyone who wants the behavior of this file should add it to their worktree themselves. I have to keep it deleted, which causes many git commands to fail because of unstaged changes, whereas adding the file to your worktree makes it untracked and git will basically never complain about it.

@grahamc
Copy link
Member

grahamc commented Oct 10, 2018

I don't personally want to save those dir-locals as trusted in my emacs config.

why not?

@ElvishJerricco
Copy link
Contributor Author

Well for one, I shouldn't have to change my emacs config and enable emacs features I don't care about to be able to productively contribute to nixpkgs. That's a silly thing to annoy any drive-by or first-time contributor with.

Also, my emacs config file is not writable, so I can't just get emacs to do it for me. I just home-manager to install the file from my dotfiles repo so it's a symlink to the nix store.

@grahamc
Copy link
Member

grahamc commented Oct 10, 2018

The most valuable part of this for newbies is the indentation width, which is already covered by editorconfig.

13:21 <gchristensen> elvishjerricco: what features does it turn on that you don't want?
13:23 <elvishjerricco> gchristensen: It's not that I'm vehemently opposed to the feature it turns on. It's just that I don't care about it, so I'd rather not have it cluttering my emacs file, plus I can't automatically add it anyway. And seeing "You must modify your emacs config to contribute to this repo" is a big annoyance to drive-by/first-time contributors=
13:23 <gchristensen> why must you modify your emacs config?
13:23  * gchristensen isn't _trying_ to be dense :)
13:24 <elvishjerricco> gchristensen: Because it's insanely frustrating to have every new buffer (including minor ones like magit UIs) also pop up this prompt "Would you like to save these things?"
13:25 <elvishjerricco> You can't tell it to *stop* asking (nor should you have to)
13:25 <gchristensen> elvishjerricco: I think I'm missing something, and I'm trying to understand what it is I'm missing -- not challenging that it is a frustrating experience
13:25 <gchristensen> elvishjerricco: dir-locals doesn't get dynamically loaded, but is instead appended to your emacs init.el or whatever?
13:26 <elvishjerricco> gchristensen: emacs asks if you'd like to apply the variables in every new buffer you open. Then, if you'd like it to stop prompting, your only option is to tell it to write to your emacs config that you trust these particular variables, so it'll open new buffers (and use the enabled features) without the prompt.
13:26 <gchristensen> ahh it has to write the trust status
13:27 <elvishjerricco> So with magit, you press one key per action you're trying to take. Each key you press opens this prompt
13:27 <gchristensen> makes sense

@grahamc grahamc merged commit 29d0eec into NixOS:master Oct 10, 2018
@lheckemann
Copy link
Member

lheckemann commented Oct 10, 2018

cc @matthewbauer who added this in July

@Zimmi48
Copy link
Member

Zimmi48 commented Oct 10, 2018

FTR I was also annoyed by this new file because every time it asked me about these variables was not the time for me to review this file.
In the Coq project, we have decided to get rid of such .dir-local.el and instead provide a coqdev.el file that people can choose to load.
In Nix, there is indeed the EditorConfig file already for which I have installed the Emacs package (although I'm not quite sure what it does).

@matthewbauer
Copy link
Member

matthewbauer commented Oct 10, 2018

Sorry about this. They were all safe local variables so it is pretty normal to have them set (Nix has done it for a while: https://github.com/NixOS/nix/blob/master/.dir-locals.el). Do you also have issues in that?

This can be configured with enable-local-variables but IIRC it defaults to t.

Was there a specific one that was tripping up? I do recall bug-reference-bug-regexp being made safe only in 26.1 it could have been a problem in Emacs 25.

@Zimmi48
Copy link
Member

Zimmi48 commented Oct 10, 2018

It could be indeed:

$ emacs --version
GNU Emacs 25.3.1

@Zimmi48
Copy link
Member

Zimmi48 commented Oct 10, 2018

I'm using the version of Emacs that is distributed with NixOS 18.03. I see that 18.09 has just released though so I'll probably be upgrading very soon. What about you @ElvishJerricco?

@matthewbauer
Copy link
Member

Sorry about that! Yeah since emacs 25 is still in 18.03 it definitely shouldn't be forgotten about. Anyway bug-reference-regexp is not all that useful so it's fine to leave .dir-locals.el off for now.

@ElvishJerricco
Copy link
Contributor Author

Oh so there will be no prompting with emacs 26, even if I've never purposefully saved the locals? If that's the case, perhaps we can add this back after giving 18.09 some time for adoption. I'm still on 18.03 (emacs 25).

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.

None yet

6 participants