5 ms·
I agree with some of them, but why is the font blurry? My poor eyes. Replace show-trailing-whitespace with automatically-deleting-whitespace, though. (defu
by clankyclanker 3y ago
I agree with some of them, but why is the font blurry? My poor eyes.
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)
- mst 3y agoThe one issue with this is for things like markdown where a code block is space-indented - if you want an empty line as part of the code block rather than two code blocks then you need a line that contains -only- the indentation. 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.
- dpifke 3y agoAnother option is to use something like ws-butler[0], which only deletes trailing whitespace on lines you've edited. This way you don't create spurious diffs on version controlled files, which confuse code reviewers and `git blame` users in the future. [0]: https://github.com/lewang/ws-butler https://github.com/lewang/ws-butler
- kqr 3y agoThis is an awesome mode. I enabled it once and then just left it in there and it quietly does its thing. I really miss it in other editors. (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.)
- pmontra 3y agoAnother way is to delete whitespace only in some modes. Example from my .emacs (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)
- pmontra 3y ago> why is the font blurry? My poor eyes 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.
- clankyclanker 3y agoYeah, confirmed, it's the shadow in dark-mode.
- alwaysbeconsing 3y agoWhy are you using `string=` to compare symbols?
- beanjuiceII 3y agoyea i don't often complain about peoples website styling but this one got me