unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* M-q on comments in source code
@ 2014-05-24 11:37 lee
  2014-05-24 12:47 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: lee @ 2014-05-24 11:37 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

modes like c-mode indent comments with the code, which is fine as an end
result and not so ideal when writing them.  To give an example:


,----
| 			if(full)
| 				{
| 					//
| 					// A max value might be removed when the arrays are shifted.  In
| 					// that case, find a new one after shifting.  Otherwise, the max
`----


Now press M-q to format the comment and the above looks like this:


,----
| 			if(full)
| 				{
| 					//
| 					// A max value might be
| 					// removed when the arrays are
| 					// shifted.  In that case,
| 					// find a new one after
| 					// shifting.  Otherwise, the
| 					// max continues to be known.
`----


This formatting is a bit silly ...  What can I do to get the comments
formatted as in the first example, i. e. the comment indented with the
source but with each line trimmed to a length of about max 75
characters, not counting the indentation?

I can manually unindent the lines, edit them, format them and reindent
them, and I`m looking for a better way.  Even something like
auto-fill-mode for comments that does it automatically would be nice.


-- 
Knowledge is volatile and fluid.  Software is power.



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

end of thread, other threads:[~2014-05-24 23:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-24 11:37 M-q on comments in source code lee
2014-05-24 12:47 ` Eli Zaretskii
2014-05-24 14:21 ` Stefan Monnier
2014-05-24 18:00   ` lee
2014-05-24 18:50     ` Stefan Monnier
2014-05-24 23:01       ` solved: " lee
2014-05-24 15:41 ` Andreas Röhler
2014-05-24 17:32   ` lee

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).