Questions tagged [fill-paragraph]
a command which wraps the words or redistributes the newlines within a paragraph as defined by the current major-mode
77
questions
0
votes
0
answers
24
views
How can I make `fill-paragraph` on selected text respect indentation in AUCTeX?
Using fill-paragraph in AUCTeX normally respects the given indentation. However, if I use fill-paragraph on a selection, only the first line will be indented, the other lines won't. Is there a way to ...
3
votes
2
answers
111
views
`fill-paragraph` prevent breaking
I'm trying to prevent fill-paragraph from breaking a certain type of string:
<<dd_display: %9.3f abs(_b[2.rep78])>>
This is an inline Stata dynamic tag. The <<dd_display: and >&...
1
vote
2
answers
58
views
How to enable `fill-paragraph` command to be executed every time ChatGPT replies via gptel package?
I have been using this cool Emacs package called gptel.
However, it is annoying for me how lengthy the ChatGPT answers look on the screen.
When I want to improve readability, I keep executing the fill-...
0
votes
1
answer
30
views
Is it possible to tune `fill-paragraph` to balance the lines?
Inspired by a recent addition of text-wrap: balance to CSS I've suddenly realized I'd like to have balanced comments in my code. Current behaviour of fill-paragraph (with my current settings) converts ...
0
votes
3
answers
123
views
How can I avoid fill-paragraph in org-mode?
Out-of-the-box Emacs (28.2, in case it matters) will use a "continuation mode" for text files. Long lines within a paragraph wrap around at the end of the frame.
Out-of-the-box Org-mode ...
0
votes
0
answers
16
views
Non-filling of lines and paragraphs when using docstrings
I am having a problem with docstrings because everything is written as verbatim without paragraph or line filling. The following for instance puts Malicious and Functionalities on two separate lines.
...
0
votes
0
answers
28
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 ...
4
votes
4
answers
479
views
How does one do the reverse of fill-region / fill-paragraph in emacs?
The commands fill-region (and fill-paragraph) breaks lines in a region (and paragraph) to a predefined width. How does one achieve the opposite effect?
Given a buffer, say markdown or org, where ...
3
votes
0
answers
196
views
Can word-wrap / visual-line-mode have different right margins per paragraph?
When visual-line mode is enabled, words wrap at the window edge. When the window is wide, this makes much too long of a line for comfortable reading. To fix that I have found visual-fill-column-mode, ...
2
votes
1
answer
238
views
How to fill a string programmatically like fill-region in elisp?
Here is what I want:
(fill-string ";; This is a long string to be inserted into a buffer somewhere. Okay that's it.")
This should insert line breaks according to the fill-column. Something ...
0
votes
1
answer
52
views
How to detect if a paragraph has been filled?
Q: how can I detect, programmatically, if a paragraph has been filled?
fill-paragraph (synonyms fail me) fills a paragraph, and related
fill-* functions do analogous things. Is there a way to detect,
...
1
vote
1
answer
134
views
How to properly fill a whole Org buffer programmatically?
I'm trying to fill programmatically an Org buffer (especially the elements quote-block, paragraph and item). Note that all following attempts contains a (org-cycle '(64)) because they all don't work ...
0
votes
1
answer
69
views
org-fill-paragraph doesn't comply with org-list-allow-alphabetical
Given that (setq org-list-allow-alphabetical t).
Consider the following example, where | stands for the point:
1. |Lorem Ipsum
1. Lorem Ipsum
1. |Lorem Ipsum
a. Lorem Ipsum
While org-fill-...
1
vote
1
answer
29
views
Specify a block of text that should not be filled (leave it "verbatim")?
Consider the following piece of text (in whatever general major mode it may be):
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna ...
0
votes
1
answer
245
views
From one-line list to one element per line in python-mode
How do I turn a long one-line list, such as
test_list = ['a0000000', 'b1111111', 'c2222222', 'd3333333', 'e4444444', 'f5555555', 'g6666666']
into a one element per line list:
test_list = ['a0000000',
...
1
vote
1
answer
127
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....
0
votes
0
answers
79
views
org-fill-paragraph in the presence of LaTeX Formula
Consider the following piece of text
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
$$e^ix = cos(x) + i \dot sin(x)$$
Lorem ipsum dolor ...
2
votes
1
answer
409
views
fill-paragraph on multiple paragraphs at once
I often cut and paste non "filled" text into text files (mostly in org-mode). I then have to go line by line and call fill-paragraph or org-fill-paragraph in org-mode to clean up the text. ...
4
votes
2
answers
286
views
How to prevent LaTeX verbatim environments to be subject to LaTeX-fill-region
With LaTeX-verbatim-environments-local, it is possible to declare environments that AUCTeX should consider as verbatim ones.
\documentclass{article}
\begin{document}
\begin{myverbatimenv}
First ...
3
votes
1
answer
330
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
212
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 ...
3
votes
1
answer
74
views
how to set a fill suffix?
I want to fill (wrap) long lines at n characters, ensuring that each new line ends with "///". (That is the "continuation character" for long lines in Stata code.
So that something like this
This is ...
2
votes
1
answer
333
views
Want to Alt-Q on a long piece of text - but it has no spaces so it doesn't work
When you press Meta-Q to wrap a long blob of text, it doesn't work, probably because my text has no spaces.
my text is the result of a curl, json with no spaces.
so how do I tell emacs to add ...
1
vote
0
answers
85
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, ...
1
vote
1
answer
217
views
About `fill-paragraph` in `markdown-mode`
I have a buffer on markdown-mode with the following contents.
10 20 30 40 50 60 70
- a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a ...
10
votes
1
answer
166
views
org-fill-paragraph in a list with checkboxes doesn't take into account the checkboxes
I'm trying to figure out a way to change the behavior of org-fill-paragraph for a list with checkboxes. I would like the indentation to take into account the checkbox, but here is what I see:
- This ...
1
vote
1
answer
211
views
is there a fill paragraph with bullets combo command for emacs
With emacs how can I easily go from this:
to this (has nice indentation and fill-paragraph):
3
votes
1
answer
192
views
Unfill `mu4e` message before sending
I would like to unfill all paragraphs before sending a message with mu4e. This is because format=flowed is not respected by all platforms (particularly Gmail).
I figure that message-send-hook is the ...
0
votes
1
answer
172
views
How to convert paragraph into the line?
I've need a function which convert a paragraph into the line, sort each space separated set of characters and fill it back to paragraph.
In:
Supposedly there are over one million words in the ...
2
votes
1
answer
487
views
What is this M-q behaviour in Emacs 26.1 message mode
Since updating to Emacs 26.1. message mode was changed so that M-q does something unexpected. I have fill-column and message-fill-column both set to 72 and pressing M-q on this text:
turns it into ...
2
votes
2
answers
205
views
Format help buffers to specific width
I'm helping a visually impaired user make viewing documentation in Emacs easier. He sets his font size such that he has about 40 columns of text in a full-screen frame with no splits (and he has ...
1
vote
0
answers
662
views
How to add additional comment syntax to a mode?
In general, given a major mode with a defined comment syntax, what do I have to define or change to add a new comment syntax? By "adding", I mean setting some new characters so that they
work with ...
3
votes
0
answers
642
views
How to justify all paragraphs of the currect buffer?
I would like to fill justify all paragraphs in the current buffer if no region is selected. I wrote the the following function which performs this job.
Is there a better way to write this function? ...
2
votes
0
answers
178
views
indent items in auctex
What I would like to achieve is a deeper indentation of lines in items in Auctex.
\begin{itemize}
\item This is what I would like to achieve. The beginning of the
second line aligns with ...
2
votes
0
answers
130
views
org-fill-paragraph leaves a comma at end of C style comment
In a src block when there is a C style comment /* ... */ doing an org-fill-paragraph would always put a comma just before the last star, like this:
/*
Some comment
,*/
Is there a way to stop it from ...
2
votes
3
answers
96
views
How to make fill-paragraph respect smileys at end of sentences?
I'm a big fan of fill-paragraph, and also sentence-end-double-space being set to t so that I can easily navigate and edit via backward-sentence, forward-sentence, kill-sentence, transpose-sentences ...
0
votes
1
answer
246
views
paragraph reflow and advance to next para?
Excuse tyro question (google hasn't helped), but the default behaviour of paragraph reflow (M-q) not advancing to the next para doesn't suit me, particularly when reflowing a large section of text, ...
1
vote
1
answer
85
views
fill-paragraph in programming
Is it possible, or does some function exists, to get the equivalent of the alt-q command, but in programming?
Suppose I've just written this in python:
group_parser.add_argument('-n',nargs=1, ...
7
votes
1
answer
434
views
fill-paragraph (`M-q`) for s-expressions?
With M-q (aka fill-paragraph), it is possible to format a single line of text nicely.
Is there a command or function which does a similar thing for lisps s-expressions?
It should break one-liner ...
2
votes
1
answer
75
views
Org-mode paragraph-start not respected
I want to configure it so that bulleted lists in org mode are there own paragraphs - for example, in a org file, i have:
. foo bar baz
. baz bar bla
When I do fill-paragraph, this results in:
. foo ...
6
votes
0
answers
198
views
Incorrect filling of Python docstrings in pep257 mode
I have python-fill-docstring-style set to pep-257 (default) and I'm trying to fill docstring paragraphs. However, python mode does not count """ towards the number of characters, nor does it consider ...
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 ...
1
vote
0
answers
91
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
0
answers
197
views
Prevent fill-paragraph from breaking Org Mode inline source block
The fill-paragraph function isn't aware of the inline Org Mode source block syntax and is able to destroy it. For instance the following paragraph
Lorem ipsum dolor sit amet, consectetur src_emacs-...
2
votes
2
answers
136
views
pasting from websites results in 1 long line..anyway to keep the paragraph format?
when copy and pasting from any web site a paragraph and pasting into emacs with S-insert, the paragraph is always a very long line. is there anyway to keep the paragraph structure?
2
votes
0
answers
373
views
Prevent fill-paragraph from breaking LaTeX displayed equations in Org Mode
In Org Mode fill-paragraph brakes the following paragraph (containing LaTeX displayed equation)
* Some headline
Text text text
\[
e=mc^2
\]
text text text.
into
* Some headline
...
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 ...
2
votes
1
answer
257
views
Disabling hanging indentations with fill-paragraph
I want to be able to fill a whole paragraph with fill-paragraph, first line included, between the left-margin and fill-column values (adaptive-fill-mode is disabled).
I am able to do this, but I ...
3
votes
1
answer
174
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
;;...
4
votes
2
answers
548
views
How can I use par as my paragraph formatter
I'm coming from vim, which has a gq operator that acts much like emacs' fill-paragraph function (M-q). There's a 'formatprg' setting that allows you to point gq at an external program for its ...