all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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 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 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 --
     [not found] <mailman.5695.1544736484.1284.help-gnu-emacs@gnu.org>
2018-12-14 18:33 ` c-fill-paragrpah for code, not just comments James K. Lowden
2018-12-13 21:28 Ken Goldman
2018-12-14  7:35 ` Eli Zaretskii
2018-12-16 20:56 ` Philipp Stephani

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.