by k_bx · 8mo ago · 0 comments
It's crazy to me how out of the box when you edit nginx file at /etc/nginx/sites-enabled/foo it creates another file foo~ there and nginx tries to load that too
When I tried to ask emacs reddit community they started attacking me for changing the default that only I need and fits everyone perfectly.
Still can't believe I'm the only one finding that default amazingly bad.
Using hidden files is a stronger convention, e.g. .foo.swp or .foo~.
But nginx's sites-enabled also doesn't filter those.
It's a very simple mechanism that assumes what you put in that directory is a website configuration.
Adding backup files here and there is considered spam, no matter how old it is.
It's the second thing I fix in either Vim or Emacs: Put backup files in a central location. (The first is proper indentation/spacing rules.)
Emacs does foo~ by default, not ~foo.
In either case, you're not really supposed to edit files in sites-enabled. That directory is expected to contain symlinks to files in sites-available. I'm not going to say with any certainty that one of the reasons for this indeed is that the pattern (which was used by apache as well - and perhaps other things before it) protects against accidentally reading backup files, but it's not impossible.
So there's definitely a case of holding it wrong if you end up with backup files in that directory.
Perhaps not a standard, but you yourself admit it's the default behavior.
Though I agree that the simple mechanism acts ... er,... simply, shouldn't it be at the very least aware of the default behavior of common editors?
That said, Nginx is also wrong and shouldn't do that.
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE
And for removable media: defaults write com.apple.desktopservices DSDontWriteUSBStores -bool TRUEWithout this I had to be careful not to acciddentally commit stuff like ".#filename.txt".
First thing I do any time I install emacs.
Note that tramp will kvetch if you do this, but it still works fine.
(setq backup-directory-alist '(("." . ".~")))(setq make-backup-files nil)
The fact it can do multi-hop edits is far too much power for us mere mortals.
nvim scp://remotemachine/.config/emacs/init.el
For the same reason you can use sshfs, sftp, and rsync with multi-hop. Gotta love openssh!
- I already have tmux launched, if ssh drops – I can continue
- I don't have to match windows to ssh sessions -- just have them in my tmux
(but I still think this is on nginx more than emacs - unless they really mean foo~ and not .foo~ )
There are a ton of Emacs users, and it's doesn't make much sense to talk about them as a group like that, no more than if I were to say, "The list of things Windows users don't get..."
You can change your own defaults quite easily!
Changing the default setup with emacs that has been shipping for > 30 years is tough.
Getting nginx to ignore a well established pattern by a well established editor seems equally sensible and perhaps more doable. Yes?
I disagree about "tough". Emacs has changed for the better in new releases quite drastically in the last years in my experience.
using the same directory drastically reduces the amount of assumptions about your system's permissions and your own installation (or lack thereof)
old school *nix editors typically do something like emacs and vi typically do, whereas old WinDOS/Mac single-user systems would have an installation file and a cache system-wide, and post NT and OS-X they have roughly the same but in a centralised user directory that is not system-wide, but is located as if it were (different evolution path)
But it's easy to disable or have them created somewhere else, which is more than you can say for most software lately.
There's also a docker package for managing containers - similar concept and UI to magit, but for managing Docker. Not as life changing as magit, but convenient.
Anyway, the problem with changing the default after all this time is that everybody would want the new default to be different, and changing it now would meaning breaking things for long time users who depend on the current default. And TBH if you're setting up a container and installing Emacs, it's very little extra work to copy over a .emacs file that fixes everything the way you like.
[1]: https://gist.github.com/imiric/812398910c59cf00ab43d9172fe42...