Hacker News new | past | comments | ask | show | jobs | submit login
Emacs Microfeature (borretti.me)
27 points by Tomte 6 days ago | hide | past | favorite | 13 comments

And if you do M-q on Lisp source code it automatically reindents it properly. I do this hundreds of times a day. (Or at least I think I do. I think "reindent" and my fingers seem to issue the proper command.)

In that case aggressive-indent-mode will save you hundreds of keystrokes per day.

I just highlight code and press tab.

does it do something special?

Or put cursor at open or closing paren of form and do M-q. No highlight needed.

I usually use visual-line-mode and visual-fill-column-mode over hard newlines. But I've always stayed away from hard newlines because I imagined that it would make exporting to another format look janky.

Why is the example word wrap so bad? It's breaking words in half.

No sane editor does it that way.

Emacs word-wrap does it the "sane" way out of the box in 26.3. The current version is 29.3. I tested it with that exact text just now. I doubt it would have gotten worse after 26.3, so something in the author's config or build is probably messing it up. Maybe he's using an even older version. Or maybe he mistakenly doesn't actually have word-wrap set.

Emacs 30.0.50 wraps charwise for me when invoked with emacs -Q. (The manual describes this as continuation lines: https://www.gnu.org/software/emacs/manual/html_node/emacs/Co...)

Word wrap is available with M-x word-wrap-whitespace.

Agreed for a completely unconfigured emacs process. But the article mentions enabling word-wrap. (That's one possible point of confusion for some - he means a variable/mode/feature with the name of "word-wrap", not just a generic word wrapping behavior.) It seems that that feature still does the sensible thing up through version 30. And from what I can tell from the mailing list, word-wrap-whitespace is an enhancement of the default word-wrap behavior that allows you to define your own whitespace chars to trigger a wrap.

But from an outsider's perspective, I see how not having ANY whitespace-based word wrapping behavior enabled by default would be off-putting.

Do you want to display long lines, or do you want to add newlines to the file?

Generally, the former is only used occasionally for code (where wrapping by words isn't usually useful), and human language text uses the latter.

Is emacs an evolutionary deadend? im looking at LLM-plugins and emac's support for chatgpt is no where near cursor or zed. I kind of want to contribute my own

that's a good thing

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