12
votes
What is the difference between refill-mode and auto-fill-mode?
If you are continuously typing text without making mistakes or editing, then the end result would be the same in both cases.
auto-fill-mode isn't so helpful when editing existing text, though (...
7
votes
Org-mode Auto-Fill-Mode
If you want to globally set auto-fill-mode, as you say, the solution would be
to put this in your .emacs.s/init.el (or equivalent):
(add-hook 'org-mode-hook 'turn-on-auto-fill)
This means that all ...
6
votes
Org-mode Auto-Fill-Mode
If you want a single org file that you share with others to get auto-filled put this as the first line:
# -*- eval: (auto-fill-mode 1) -*-
This will cause auto-fill minor mode to be used when the ...
5
votes
What is the difference between refill-mode and auto-fill-mode?
refill-mode does more than auto-fill-mode, and does it automatically.
This may be what you prefer but there are situations where refill-mode is not convenient. E.g., when you edit text shared with ...
5
votes
Accepted
How to have fill-paragraph/fill-region break the line after a period?
You have sentence-end-double-space set to its default value,
which is t. The relevant part of the docstring:
Documentation:
Non-nil means a single space does not end a sentence.
This is ...
Dan♦
- 33.4k
4
votes
Accepted
org-mode, auto new line at 80th column?
This will work:
(add-hook 'org-mode-hook '(lambda () (setq fill-column 80)))
(add-hook 'org-mode-hook 'auto-fill-mode)
It enables a minor mode called auto-fill-mode that does exactly what you asked ...
4
votes
Accepted
Prevent hooks from parent mode in derived mode
Prevent hooks from parent mode in derived mode
Not trivial. I certainly can't think of a nice approach. You may find https://stackoverflow.com/a/19295380 of interest, though.
How can I disable ...
3
votes
Org-mode Auto-Fill-Mode
If you want to fill all the lines in a region, use the command M-x fill-region. To mark the entire buffer (so the region includes the entire file), use the command M-x mark-whole-buffer, which is also ...
3
votes
Accepted
Problems trying to turn on auto-fill in a directory local way
The directory local variables are set after the major mode command run. Otherwise the major-mode dependent file local variables would not work.
Therefore, you just buffer-locally add turn-on-auto-...
3
votes
Accepted
Prevent fill-paragraph from wrapping past horizontal rules
You can add the following lines to your init-file. Additionally to the default setting, they define lines consisting of at least two equal non-alphanumerical characters as paragraph start and ...
3
votes
Separate fill-column value for org-mode
This should do it:
(add-hook 'org-mode-hook
(lambda () (setq fill-column 100)))
2
votes
Accepted
Strategy for proper version control of "auto-filled" text files
Yes, you want visual-line-mode. See the Emacs manual section 14.22 (run M-: (info "(emacs)Visual Line Mode") to jump right to it inside Emacs).
2
votes
How to have fill-paragraph/fill-region break the line after a period?
I'm referring to Emacs Wiki to answer your question.
Paragraph Boundaries
By default, text-mode assumes that empty lines separate paragraphs. The boundaries of paragraphs are determined by two ...
2
votes
I keep accidentally turning on fill mode; how am I doing this, and how do I undo it?
When some key sequence triggers an unexpected command, use view-lossage (bound to C-h lby default) to see what keystrokes Emacs has recently received. This is most useful since Emacs 25 as it now ...
2
votes
What is the difference between refill-mode and auto-fill-mode?
M-x auto-fill-mode inserts newlines as you keep inserting characters. M-x refill-mode goes a step further, it triggers on all kinds of changes, including deletion of text (and undoes filling if ...
2
votes
Accepted
Org mode: Turn off auto-fill altogether?
Org mode is a derived mode of Text mode: if you turn auto-fill-mode on for Text mode, then you turn it on for all derived modes, including Org mode. If you want it on for Text mode but want it off for ...
2
votes
Make Emacs fill in text up to 80 columns
I assume that you are using M-q (fill-paragraph) to wrap the text? If so, then it breaks the text at the end of the last word prior to the fill column. This does leave most lines shorter than the fill-...
2
votes
turn off auto-fill in org tables?
Try not setting auto-fill-function at all in your config file: it is set from normal-auto-fill-function which is do-auto-fill by default, but it is org-auto-fill-function in Org mode buffers. There is ...
2
votes
Accepted
Python Documentation String Indent In Auto-Fill Mode (Emacs 26.2)
This is the expected behaviour as resulted from the emacs manual:
When Auto Fill mode breaks a line, it tries to obey the adaptive fill prefix: if a fill prefix can be deduced from the first and/or ...
2
votes
fill-paragraph does not honor fill-column
Filling is a general facility which can depend on more than just the fill-column variable, however the first thing to test is simply that you're checking the fill-column value for the correct buffer --...
1
vote
Accepted
auto-fill-mode without automatic indentation
Presumably, you want to use paragraph-indent-text-mode or paragraph-indent-minor-mode which are resp. major and minor modes to use when editing text where paragraphs are separated by having the first ...
1
vote
ES6 imports auto suggestion
As DoMiNeLa10♦ metioned, lsp-mode can do this:
You should install typescript-language-server in your system and lsp-mode, js2-mode, autocomplete in your emacs. You can check these link for more ...
1
vote
How do I stop lsp-mode from re-indenting my comments after a newline
I found this: https://github.com/emacs-lsp/lsp-mode/issues/1342
A comment there suggested setting lsp-enable-on-type-formatting to nil. I did that and re-opened a file, and it worked for me. It was no ...
1
vote
Accepted
How can I run auto-fill before each save in the complete buffer?
I think this is what you are after; let me know if not.
(defun fill-buffer ()
"Fill whole buffer"
(interactive)
(fill-region (point-min) (point-max)))
(add-hook 'before-save-hook 'fill-...
1
vote
Accepted
Set auto-fill in markdown mode, but exclude code block headers
auto-fill-mode refers to the variable auto-fill-function to determine how to fill lines. auto-fill-function is always a local variable, making it easy to define your own function for any mode you like....
1
vote
Accepted
(Sudden) Weird behavior of M-q in auctex
Entries in LaTeX-indent-environment-list control the filling behavior in environments. If you want the standard filling AUCTeX applies to environments, remove entries for your appendices from it and ...
1
vote
How to set automatic indentation to move past numbers on first line?
I customized variable adaptive-fill-regexp by adding 0-9. to the big character class. We'll see how it works out, but preliminary results look promising.
1
vote
Accepted
Auto line break in a specified window
auto-fill-mode is what you look for.
You can type M-x auto-fill-mode to toggle it to be enabled,
then type SPC to let it do filling automatically after copying/yanking the content.
1
vote
Accepted
Turn on auto-fill-mode when editing a commit message with Magit?
I had comment-auto-fill-only-comments set to t. Since Magit commit buffer supports comments, it won't auto-fill.
(use-package git-commit
:ensure nil
:preface
(defun me/git-commit-set-fill-...
1
vote
Turn on auto-fill-mode when editing a commit message with Magit?
As far as I know, neither git-commit-fill-column nor
git-commit-turn-on-auto-fill is deprecated, although the docstring
of git-commit-fill-column suggests that you use fill-column
directly. (Before ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
auto-fill-mode × 42fill-paragraph × 11
org-mode × 7
fill-column × 4
indentation × 3
text-editing × 3
python × 2
spacemacs × 1
magit × 1
evil × 1
auctex × 1
git × 1
yasnippet × 1
functions × 1
auto-complete-mode × 1
whitespace × 1
comment × 1
formatting × 1
javascript × 1
lsp-mode × 1
directory-local-variables × 1
cc-mode × 1
markdown-mode × 1
version-control × 1
deletion × 1