;; Basically, I was laboring under the impression that
;; `sentence-end-double-space' was telling Emacs the /right/ way to do
;; end-of-sentence spacing, but really it's just letting it know how sentences
;; work. So setting it to nil lets you do sentence-level stuff, even on people
;; who are /wrong/. So great.
I assume they were mostly kidding and this was only meant to be funny, but I learned the 2 spaces thing in college and then didn’t discover until a couple years ago that it had fallen out of fashion decades earlier, even before I went to college. IIRC the reason for the 2 spaces rule is because you need it in print, for non-fixed-width fonts, where the space character is really narrow. I think I even read that there never was a 2-space rule for fixed-width fonts? (*Edit just to say I think I (mis)remembered this story completely backward, and the corrections below are accurate. Print had different sized spaces already, typewriters need 2 to match.)Anyway. I loved emacs back in the day, and for a long time, but over many many years my .emacs file bloated up to like a megabyte. (That might* be a slight exaggeration, but I’m not sure.) I can’t maintain it anymore. I probably have a very very enormous list of bad emacs defaults.
But yeah, it's weird the effects of backwards compatibility... so many things decided 40 years ago, which we can't change because it would break someone's configuration.
[1] https://link.springer.com/article/10.3758/s13414-018-1527-6
i.e. if point is at the beginning of "This is Mr. Smith's hat. It is green." I want next-sentence to advance to "It", rather than "Smith".
I also gave in and started top-posting in email messages.
Then I realized that the 1st sentence was missing the extra space after the 2nd period, and then M-e jumped to the end of the first sentence.
In vim, hitting ) in normal mode stopped after each period.
I definitely recommend doing some form of "dotfile bankruptcy" every 20 years or so :-)
(I also ended up doing a crude "load-file-literate" so that now most of my elisp is actually markdown, inspired by https://github.com/skx/dotfiles )
The wider form of whitespace is not easy to get out of regular text editors and word processing software, so some people choose to emulate it by entering two regular word separators. (This is too wide, though, if we are being precise.)
I didn't quite realize that was the reason for the double space until these comments, though, as we were simply taught that it was required to put 2 spaces after a period.
The comma, btw, was slightly wider.
emacs-bankruptcy court is now in session. mr. dahart would you like to say something/anything before we begin ?
Specifically, 'one indent is four spaces, two indents is one tab, repeat', which caused utter carnage for newbies editing YAML files since literal tabs aren't valid YAML.
Back in the day, I built consensus to switch the perl https://p3rl.org/Catalyst framework over to defaulting to an apache style config in the scaffold generator specifically because about 75% of our "confused newbie" questions on IRC at the time were people whose emacs config had broken their YAML config file.
Of course we're -ahem- a few years on from that now, and people generally have already had at least one pitched battle with YAML before installing/adopting another thing that uses it, but still, oh gods but that was frustrating for a while.
If your language has a convention, then likely Emacs implements it. If not, you can send a patch to fix it.
Also with homeassistant I was "forced" to write a lot of yaml by hand and also never had real issues. Maybe its because emacs handles writing yaml fine. Anyways. I like yaml.
But as a default for any mode that cycle is ... nuts. Though I'm sure there must have been some reason for it.
The standard tab width (in most software, not just emacs) is 8. Basically nobody wants that much indentation, so your options are:
(1) Don't use tabs at all. Just use spaces. If space efficiency is a requirement, that eliminates this option.
(2) Use tabs only and change the tab width to match your desired indentation level. This is a simpler method. The downside is other people need to change their tab width to match yours. They may not want to, or their software may not support it. You have to decide whether you want to deal with that.
(3) Mix tabs and spaces. This is more complicated, but most software will display the files as expected without any tweaking.
TLDR: Tabs save disk space, but tabs are too wide, and changing tab width is a hassle, so mixed tabs/spaces is a compromise.
So "apparently under some distro configs in some circumstances it does that" is pretty much all I bothered to find out, because the config data structures people were mostly expressing worked fine with a less touchy format. (and this was only the -default- format configured by the scaffold, if you handed the config system a YAML file it was still happy to load it)
Today I learned why sometimes my YAML files seemed inexplicably to end up with tabs in them.
For example, I would argue that MOST modern text editors treat a tab as approximately 4 spaces, not 8 spaces.
Exactly how said "some configurations" came to be I never figured out, it may have been a particular set of distro defaults.
Replace show-trailing-whitespace with automatically-deleting-whitespace, though.
(defun x/delete-whitespace ()
(unless (or (string= major-mode 'diff-mode)
(string= major-mode 'hexl-mode))
(delete-trailing-whitespace)))
(add-hook 'before-save-hook 'x/delete-whitespace)They have basically no css on that site. You should be seeing the default font of your browser. However, if you are browsing in dark mode you should see these colors and a text-shadow:
@media (prefers-color-scheme: dark) {body, a, a:visited {
color: #feec7c; background-color: #1e0708;
text-shadow: 0 0 3px #fde02d, 0 0 12px #b74312;}}
Maybe that shadow is the blurriness you are experiencing. Unfortunately I can't check, I don't even know how to switch my browser to dark mode.(Of course, $employer enforces whitespace style globally with a linter so the files here can't end up in a state where ws-butler is meaningful. Not sure what I prefer.)
I would expect that emacs being emacs it's trivial to configure such lines to be left alone when relevant, but it's worth remembering that the edge case exists.
(setq-default show-trailing-whitespace t)
(defun delete-trailing-whitespace-hook()
(add-hook 'before-save-hook 'delete-trailing-whitespace))
(add-hook 'ruby-mode-hook 'delete-trailing-whitespace-hook)
(add-hook 'python-mode-hook 'delete-trailing-whitespace-hook)
(add-hook 'lisp-mode-hook 'delete-trailing-whitespace-hook)Other than that: author has some very unique problems (changing fonts so often that they need to adjust how Emacs window fills the screen). Most people change fonts... never. A small fraction -- once or twice, at the time they install and configure the system. The author might be the only person in the world with that problem, but acts as if everyone does the same, and needs a solution.
Author doesn't understand why file backups are done they way they are done and advises to make them less reliable.
Putting all backups in the same directory will be inconvenient for files named in the same way.
C-h is one of the first keys anyone learns about Emacs and it's used all over the place in various combinations. Turning this functionality off in favor of a command that already has a key for it is just stupid.
Sentences need two spaces between them to distinguish them from acronyms, abbreviations and other uses of punctuation (like in proper names of products or references to pieces of code). This is the easiest way to deal with this problem. If you don't write two spaces at the end of a sentence, the editor will not be able to reliably determine where the sentence ends, and will screw up your formatting every now and then.
> command that already has a key for it is just stupid
backspace is one of the most inconvenient keys, so there is nothing stupid about replacing it with a much more convenient alternative (though the Ctrl default of Emacs is another bad default)
And he's changing the font size, not font
> Putting all backups in the same directory will be inconvenient for files named in the same way.
if only it were somehow possible to create subfolders or slighly change the names and store links in the backup...
Even when I used a more traditional "straight" keyboard I didn't have problems with it... Also, it's usually bigger than character and digit keys, so, really, it's not that hard to press it...
> so there is nothing stupid
I literally wrote what is stupid about it. Please take a minute to read the post you are replying to.
> if only it were somehow possible to create subfolders or slighly change the names and store links in the backup...
This is irrelevant. What if you rename the directory where you worked with files that need backups? Even worse, what if you switched two directories. Or deleted and created afresh... There are plenty of cases where renaming of backups will be very confusing / will do something you didn't intend and for zero gain.
I didn't really have problems with this even though I too use a tiling manager (StumpWM).
I've come to the conclusion that Emacs is a black hole, and people who profess their love for it in 2023 are likely exhibiting some form of the sunk cost fallacy. Life is too short to spend all your time configuring it.
That said, I don't think you can draw too many conclusions about Emacs from how difficult it is to turn Doom into your own bespoke setup. It abstracts a huge amount, drastically changes default behaviours, and basically needs an entire new ecosystem of Doom compatible packages, of varying quality, to make it work. I often advise that even if people plan to go Doom or Spacemacs, they should spend a week or two trying out vanilla Emacs with their own customisations applied as they go.
Not only do people tend to warn up to them, but even if they still choose to go down the Doom/Spacemacs/Whatever route, they have a better understanding of what's being abstracted away, and how to sometimes glue things back together when something breaks.
Therefore, I dropped Doom Emacs and am very happy with my new clean Emacs config.
Critisizing sophisticated tools though, that's like saying we should go back to drafting tables rather than use autocad because the learning curve is steep. Once you learn the tool it accelerates everything you do.
(setq auto-save-file-name-transforms '((".*" "~/.emacs.d/autosave/" t)))
(setq backup-directory-alist '(("" . "~/.emacs.d/backup")))I'll also note that folks have been going back and forth about ^H & DEL at least since the 80s.
Hopefully, at some stage, make-backup-files will be set to nil. It is annoying to log into any server, launch Emacs and discover you have generated lots of litter. I think at this stage backup files should be opt in, not opt out.
But yes, remote backups... Happily, they are now controlled by tramp-backup-directory-alist, so you can have your cake and eat it:
(setq tramp-backup-directory-alist (("." . "~/.emacs.d/.local/cache/backup/")))Nonetheless, I do like mg!
au!
set noai
set sm
set cp
setf none
set nocindent
set nosmartindent
filetype off
inoremap <Left> <NOP>
inoremap <Right> <NOP>
inoremap <Up> <NOP>
inoremap <Down> <NOP>
noremap <F1> <NOP>
inoremap <F1> <NOP>
cabbr h you_typed_colon_h_again_you_idiot
nnoremap q <NOP>
autocmd FileChangedShell \* echon ""
set directory=/tmp
set mouse=
set ttymouse=
# try uncommenting this if angry fruit salad still ensues:
# syn offIt's also more robust in case of errors. Emacs can write new data to a temp file, confirm it succeeded then rename working to backup and new to working. You never have a situation where the working or backup file ends up half written.
Granted, hugo is handling this particularly gracelessly, but it's not the only thing that gets confused and upset by the dangling symlinks that point nowhere.
Yeah, it breaks other various compilers like ghc too.
I fix it with:
(use-package no-littering
:demand t
:config
(no-littering-theme-backups)
)
https://github.com/emacscollective/no-litteringEdit: not just hard to read, but physically painful. I noped out of reading TFA because it’s not worth using my limited eye strain budget for the day.
Which is not an unreasonable topic for an article though as it happens I disagree with almost all of them.
Emacs is a perfect case of “YMMV — and you can adjust it”.
(setf dired-kill-when-opening-new-dired-buffer t)
To make dired not open a new buffer every time you navigate to a directory.Do you use tabs and have "workspaces" where each may have a dired buffer?
> An extremely minimal Emacs starter kit uses just one external package by default, and only GNU-ELPA packages on an opt-in basis. Intended to be copied once and then modified as the user grows in knowledge and power.
- For the long-tail of software you can just ship it without worrying about the defaults or future backwards compatibility concerns because it won't hurt that many
- For popular software though the early defaults that work great for that era (and maybe a hundred people) will annoy all the tens of thousands of future users
It was like an editing PVP game where these would be fixed in near real-time by others in the document we were working on :-)
Yes the web text today removes these today but I still prefer reading text in the old RFC document style where it's not only fixed width fonts, but also right and left column justified. In emacs this can be done by selecting a region and doing a C-u ESC q
:-)
But at some point the emacs folks decided that in a X11 window, Ctrl-Z should be bound to the same kind of idea: it minimizes the window! So you're happily typing along and hit C-x <something> and... your window just disappears because you missed and hit the adjacent key. Terrible default, have had it disabled for decades.
;; Highlight end of buffer
(setq-default indicate-empty-lines t)
is my most important one, when i open a file i need to know where it ends, vim has his by default i am not even sure if you can disable it in vimThese two things are incompatible with using cut-and paste in Windows, not to mind some other OS. One reason I switched to vi was I found vi worked better in mixed workflow where I sometimes used an IDE like IntelliJ IDEA, used a lot of web applications, and did a lot of cut and paste, which “just works” with vi assuming you go into insert mode when pasting.
Also at the time I was doing a lot of sysadmining where I would have to use somebody else’s account where there might be no emacs and certainly not my customizations or be working on a broken machine where the package manager might well be screwed up so installing emacs is not easy, besides the stakeholders on that machine have gotten along fine without emacs so why install some package just for me?
I'm a fan of using packages that hook into Emacs defaults. Like providing data for xref for example.