Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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)


> 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.


Yeah, confirmed, it's the shadow in dark-mode.


Another 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


This 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.)


The 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.


I never use indent in markdown. I always use ~~~. This makes copy/paste much easier.


I use

  ```
  code
  ```
of course as first characters of lines. It appears indented here on HN.

I didn't know about the triple tilde.


Another 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)


Why are you using `string=` to compare symbols?


yea i don't often complain about peoples website styling but this one got me




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: