Questions tagged [auto-fill-mode]
The auto-fill-mode tag has no usage guidance.
42
questions
0
votes
0
answers
34
views
Why is auto-fill-mode in sh-mode not always putting a space after the leading '#' comment character?
I'm trying to find why the auto-fill-mode of a sh-mode buffer (with "# " as comment) sometimes does and sometimes does not put a space character after the leading '#' comment. As a secondary ...
1
vote
1
answer
49
views
Org mode: Turn off auto-fill altogether?
I'd like to turn auto-fill in org-mode. I see that it can be done on a per-file basis, this way, but I'd like to do it altogether.
This answer describes that by default, normal-auto-fill-function is ...
0
votes
1
answer
72
views
Make Emacs fill in text up to 80 columns
I'm using Emacs-28.2 (9.0) on MacOS Sonoma 14.3 and Emacs 26.1-10 on RedHat-8.8. In both cases I have the same config with the following setting:
(setq fill-column 79)
So I was expecting that when I ...
1
vote
1
answer
119
views
turn off auto-fill in org tables?
I have (setq-default auto-fill-function 'do-auto-fill) in my config file, and I'm noticing that in org mode, auto-fill/wrapping occurs even within (wide) tables, which I don't like.
I confirmed that ...
1
vote
2
answers
231
views
How do I stop lsp-mode from re-indenting my comments after a newline
I just installed lsp-mode for use with C++. It's reformatting my comments as I type. For example, if I have a doxygen comment like this:
/// Blah blah blah ... blah blah the end. [cursor here]
///
...
0
votes
1
answer
82
views
How can I run auto-fill before each save in the complete buffer?
When I have a line greater than 80 columns and press enter at the end of the line it breaks the line. So in order to break the line I had to go to end of the long line and press enter.
Instead could ...
0
votes
0
answers
34
views
How to enter newline in refill-mode
If I try to split up a paragraph with refill-mode enabled, it fills
immediately after, effectively cancelling out the entered newline.
Say I have this paragraph (with | as the cursor):
Pellentesque ...
0
votes
1
answer
164
views
Set auto-fill in markdown mode, but exclude code block headers
I want to use auto-fill-mode in Markdown files. By default, it works fine, with one exception. I'm using the RMarkdown variant of markdown. This requires that code block headers remain on one line. ...
1
vote
1
answer
138
views
(Sudden) Weird behavior of M-q in auctex
I very much enjoying using the auto fill functionality that the key binding M-q provides. However, starting recently, I am experiencing a small (but annoying) change in its behavior when in LaTeX mode....
3
votes
1
answer
40
views
How to set automatic indentation to move past numbers on first line?
I'm using auto-fill-mode with indented-text-mode to write numbered lists. I'm trying to figure out how to persuade the automatic indentation to move past an item number on the first line. I'm ...
3
votes
1
answer
418
views
fill-paragraph does not honor fill-column
C-h v fill-column gives me 80.
Pasting the lorem ipsum text in *scratch* (lines longer than 80) then going M-x fill-paragraph fills around column 66.
The same in c-mode. In this mode, comment wraps ...
1
vote
1
answer
215
views
auto-fill-mode without automatic indentation
Is it possible to prevent auto-fill-mode from automatically indenting new lines according to the previous? I would like new lines to begin at column 0 regardless of the previous line's indentation.
1
vote
1
answer
235
views
Auto fill of # style comments in Emacs python-mode not working
My expectation is that, like for comments in other language modes besides python, I could write a long comment, say 150 chars, and it would automatically fill, i.e., newline and indent with comment ...
1
vote
0
answers
123
views
How to avoid annoying `auto-fill` behaviour in `c-mode` comment?
Recently I write quite a lot comments for c/c++ files. I use auto-fill-mode for comment auto format. But I found a quite annoying problem: whenever I input SPC at the end of a comment line, the cursor ...
1
vote
1
answer
939
views
ES6 imports auto suggestion
I'm new to emacs and trying to setup emacs for ES6/React developement. I would like to have auto suggestions for es6 imports like lodash similar to vscode (as shown in screenshot). Is there a way to ...
1
vote
2
answers
184
views
Python Documentation String Indent In Auto-Fill Mode (Emacs 26.2)
I've noticed a peculiar behavior when using auto-fill-mode editing Python code. For example if I start typing the following (fill-column is set to 79):
def some_function(keyword_argument0, ...
7
votes
4
answers
5k
views
Org-mode Auto-Fill-Mode
Whenever I open an org file, I have to activate auto-fill-mode and go through every signle line that I need to read and press RET to get a filled paragraph. Is there any way to globally set auto-fill-...
1
vote
0
answers
88
views
Why does Emacs fill-paragraph corrupt this paragraph layout?
To reproduce what appears to be a bug that I'm encountering, create a new buffer with Emacs 26.1 (Fundamental mode is fine), and paste the following text in:
Without message passing to worry about, ...
12
votes
3
answers
2k
views
What is the difference between refill-mode and auto-fill-mode?
I tried to read the documentation, but in practice, I could not tell the difference. I feel they are doing the same thing. I can turn both modes on, but I am not sure in what circumstance I need to do ...
0
votes
1
answer
57
views
Auto line break in a specified window
I copy content to *.org file, but it does not break lines (fill) automatically.
It's a very long sentence.
How could I enable it to fill automatically?
0
votes
1
answer
314
views
Problems trying to turn on auto-fill in a directory local way
I am inexperienced in Emacs and very new to directory-local variables, so please forgive any obvious things I may be missing.
I am trying to have auto-fill mode activated for all the files in a ...
4
votes
1
answer
4k
views
org-mode, auto new line at 80th column? [duplicate]
When I'm writing in org-mode I want it to automatically handle the creation of new lines similar to MS Word.
Can anyone recommend an .emacs config that will only apply to org-mode?
2
votes
2
answers
1k
views
Turn on auto-fill-mode when editing a commit message with Magit?
I have tried:
(add-hook 'git-commit-mode-hook '(lambda ()
(setq fill-column 72)
(turn-on-auto-fill)))
In both cases, auto-fill-...
1
vote
1
answer
245
views
I keep accidentally turning on fill mode; how am I doing this, and how do I undo it?
I must be hitting some combination of shortcut keys, because my Emacs keeps on switching all of its buffers to the minor mode 'fill'.
It's trivial to turn the mode off on each buffer individually, ...
3
votes
1
answer
304
views
Prevent hooks from parent mode in derived mode
I have:
(add-hook 'text-mode-hook 'turn-on-auto-fill)
but in lisp/nxml/nxml-mode.el:
(define-derived-mode nxml-mode text-mode "nXML"
All XML files is opened with auto-fill-mode. That is ...
3
votes
1
answer
102
views
Prevent fill-paragraph from wrapping past horizontal rules
Say I have the following document:
Sir Bedevere
------------
Well, now, uh, Lancelot, Galahad, and I, wait until nightfall, and then leap out of the rabbit, taking the French by surprise - not only ...
0
votes
2
answers
132
views
Strategy for proper version control of "auto-filled" text files
I like auto-fill-mode a lot because it makes text fit into my screen even when I have two buffers side-by-side.
My problem is that a small wording change may trigger auto-fill to reformat a whole ...
1
vote
0
answers
94
views
auto-fill-mode fails in comment with empty second line
Consider the following comments:
;; This is the first line of a comment.
;;
;; This is the second line, which begins a paragraph. If I have
;;auto-fill-mode enabled, I lose the leading space!
;; ...
2
votes
1
answer
1k
views
Separate fill-column value for org-mode
I've set fill-column value to be 80. But, especially for org-mode I want a bit higher fill-column value. Is it possible for org-mode to have a separate fill-column value of say 100?
6
votes
2
answers
1k
views
How to have fill-paragraph/fill-region break the line after a period?
I'm having trouble getting Emacs to properly fill a section of text when the last word of a suitable line ends with a period. Emacs seems to think that words separated by a period (and space) are ...
3
votes
0
answers
102
views
Enabling auto-fill-mode only when document already filled
I have turn-on-auto-fill as part of my text-mode-hook. This works great for new documents, but when I open a buffer that is not filled with hard breaks I rarely want to start doing so to a single ...
3
votes
1
answer
191
views
Emacs auto fill on period
How can I tweak Emacs auto-fill to fill when a period is inserted?
For example, with a (setq fill-column 10) the following will auto-fill when I press the space after "fill".
;; good fill
;; good
;;...
1
vote
1
answer
363
views
Allow auto-fill to break words
By default, auto-fill will only break a line at a whitespace character. Usually this is what you want. However, I'm writing a major mode for editing data files (DNA sequences) that contain long lines ...
1
vote
0
answers
35
views
Autofill insert a special string before returning
I use autofill in org mode to return automatically after 80 characters, the thing is that when exporting to html newlines aren't automatically added.
So I would like to know if it is possible to tell ...
2
votes
1
answer
1k
views
80 columns with autofill-mode doesn't return automatically
I have set autofill to 80 with C-x f and autofill-mode is enabled (I see Fill in the modeline), but it doesn't return automatically after 80 characters.
How can I make it works ?
3
votes
1
answer
155
views
Fill-column conflicts with YASnippet [Examples in gif]
I use fill-column in my dot-Emacs. And I have the following setting:
(turn-on-auto-fill)
(set-fill-column 60)
The result looks like this:
Every time when the input exceeds columnnumber 60, it will ...
4
votes
1
answer
1k
views
Fill is not working in org-mode?
While in org-mode I've tried calling fill-paragraph directly. I've tried using auto-fill-mode and refill-mode. I've tried org-fill-paragraph. The fill-column is set appropriately. None of them ...
1
vote
0
answers
55
views
auto-fill and auto-hscroll interferes, causing unnecessary horizontal scrolling
When both auto-fill-mode and auto-hscroll-mode are enabled, I often end up with a window that is horizontally scrolled, even though the entire content of the window should fit into an unscrolled ...
7
votes
1
answer
786
views
How realign existing contents of buffer on column-width?
I added the following settings to my dot-Emacs:
(add-hook 'org-mode-hook 'turn-on-auto-fill)
(add-hook 'org-mode-hook
(lambda() (set-fill-column 80)))
When I'm typing sentences in an ...
4
votes
1
answer
278
views
Simple fill-sentence function
I am new to emacs and would like to make a simple function to automate a series of commands I use repeatedly.
In auto-fill-mode after I edit the text I often need to re-wrap the lines. (I am writing ...
0
votes
1
answer
145
views
Emacs adding comment char when using auto-fill-wrap
I'm pretty new to emacs, so this might be a stupid question but
I have auto word wrap enabled like so:
(setq-default auto-fill-function 'do-auto-fill)
But when I try to use it in C files, It ...
1
vote
1
answer
870
views
How to delete word in next line with evil-mode?
I use evil-mode (from spacemacs) and I get a strange behaviour which I'm not sure if it is right or a bug. If I delete words (with dw, i think it calls evil-delete), it works until I arrive at the ...