unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* c-fill-paragrpah for code, not just comments
@ 2018-12-13 21:28 Ken Goldman
  2018-12-14  7:35 ` Eli Zaretskii
  2018-12-16 20:56 ` Philipp Stephani
  0 siblings, 2 replies; 4+ messages in thread
From: Ken Goldman @ 2018-12-13 21:28 UTC (permalink / raw)
  To: help-gnu-emacs

Subject says it - I want to fill the code as well as comments.  How 
would I do that?

(The use case is auto-generated code that has to be pasted into a Word 
document and has a line length limit.)




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: c-fill-paragrpah for code, not just comments
  2018-12-13 21:28 c-fill-paragrpah for code, not just comments Ken Goldman
@ 2018-12-14  7:35 ` Eli Zaretskii
  2018-12-16 20:56 ` Philipp Stephani
  1 sibling, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2018-12-14  7:35 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Ken Goldman <kgoldman@us.ibm.com>
> Date: Thu, 13 Dec 2018 16:28:20 -0500
> 
> Subject says it - I want to fill the code as well as comments.  How 
> would I do that?

What do you mean by "fill the code"?  Source code cannot in general be
arbitrarily broken between lines, so it's not the same as filling
text in comments.

If you want to reindent it, then mark the region and type "C-M-\", but
I'm not sure this is what you want.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: c-fill-paragrpah for code, not just comments
       [not found] <mailman.5695.1544736484.1284.help-gnu-emacs@gnu.org>
@ 2018-12-14 18:33 ` James K. Lowden
  0 siblings, 0 replies; 4+ messages in thread
From: James K. Lowden @ 2018-12-14 18:33 UTC (permalink / raw)
  To: help-gnu-emacs

On Thu, 13 Dec 2018 16:28:20 -0500
Ken Goldman <kgoldman@us.ibm.com> wrote:

> (The use case is auto-generated code that has to be pasted into a
> Word document and has a line length limit.)

Ah, so what you really want to do is format the code to fit the
allotted space.  That's not "filling", which usually means to re-flow
the lines as prose.  

I don't know the emacs answer.  I think you'll find that GNU indent has
all the knobs you need, though.  

--jkl



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: c-fill-paragrpah for code, not just comments
  2018-12-13 21:28 c-fill-paragrpah for code, not just comments Ken Goldman
  2018-12-14  7:35 ` Eli Zaretskii
@ 2018-12-16 20:56 ` Philipp Stephani
  1 sibling, 0 replies; 4+ messages in thread
From: Philipp Stephani @ 2018-12-16 20:56 UTC (permalink / raw)
  To: kgoldman; +Cc: help-gnu-emacs

Am Do., 13. Dez. 2018 um 22:30 Uhr schrieb Ken Goldman <kgoldman@us.ibm.com>:
>
> Subject says it - I want to fill the code as well as comments.  How
> would I do that?

If this is for C/C++ code, I'd recommend to use ClangFormat, it has an
Emacs integration:
https://clang.llvm.org/docs/ClangFormat.html#emacs-integration



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-12-16 20:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-13 21:28 c-fill-paragrpah for code, not just comments Ken Goldman
2018-12-14  7:35 ` Eli Zaretskii
2018-12-16 20:56 ` Philipp Stephani
     [not found] <mailman.5695.1544736484.1284.help-gnu-emacs@gnu.org>
2018-12-14 18:33 ` James K. Lowden

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).