all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
Cc: rms@gnu.org, lennart.borgman.073@student.lu.se,
	emacs-devel@gnu.org, bug-cc-mode@gnu.org,
	monnier@iro.umontreal.ca, miles@gnu.org
Subject: Re: Fill for // style comments in C
Date: Mon, 27 Nov 2006 10:47:29 +0100	[thread overview]
Message-ID: <456AB431.4020103@gmx.at> (raw)
In-Reply-To: <BAY112-F2E6F1C00CAFC5A2F3DA88DAE60@phx.gbl>

[-- Attachment #1: Type: text/plain, Size: 506 bytes --]

 > And in c-mode, pressing M-q in between comments like this:
 >
 > // A real long comment that will cause the fill command in Emacs C mode
 > making mistakes.
 >
 > will get
 >
 > // A real long comment that will cause the fill command in Emacs C
 > mode making mistakes.

It's because `c-fill-paragraph' calls `c-mask-paragraph' the latter
calls `fill-paragraph' and `fill-paragraph' gets it wrong since it has
`comment-end' set to " */" instead of nil.  Does the attached workaround
remove the problem?

[-- Attachment #2: cc-cmds.patch --]
[-- Type: text/plain, Size: 636 bytes --]

*** progmodes/cc-cmds.el	Mon Nov 27 10:32:48 2006
--- progmodes/cc-cmds.el	Mon Nov 27 10:33:20 2006
***************
*** 3897,3903 ****
  	      (prog1
  		  (save-restriction
  		    (narrow-to-region beg end)
! 		    (apply fun args))
  		(if point-rel
  		    ;; Restore point if it was outside the region.
  		    (if (< point-rel 0)
--- 3897,3905 ----
  	      (prog1
  		  (save-restriction
  		    (narrow-to-region beg end)
! 		    (if (eq c-lit-type 'c++)
! 			(apply 'fill-comment-paragraph args)
! 		      (apply fun args)))
  		(if point-rel
  		    ;; Restore point if it was outside the region.
  		    (if (< point-rel 0)

[-- Attachment #3: Type: text/plain, Size: 347 bytes --]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

  reply	other threads:[~2006-11-27  9:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-18  0:09 Fill for // style comments in C Lennart Borgman
2006-11-18  0:29 ` Miles Bader
2006-11-19 12:47   ` Richard Stallman
2006-11-27  2:34   ` Richard Stallman
2006-11-27  6:07     ` Stefan Monnier
2006-11-27  6:34       ` Miles Bader
2006-11-27  7:44         ` Herbert Euler
2006-11-27  9:47           ` martin rudalics [this message]
2006-11-27 13:15             ` Herbert Euler
2006-11-28  2:32             ` Miles Bader
2006-11-28  5:19               ` Herbert Euler
2006-11-28  5:58                 ` Miles Bader
2006-11-28  6:27                   ` Herbert Euler
2006-11-28 21:41               ` martin rudalics
2006-11-29 16:26                 ` Richard Stallman
2006-11-29 18:21                   ` Stefan Monnier
2006-11-28  8:20             ` Herbert Euler
2006-11-28 11:35               ` Herbert Euler
2006-11-28 12:34                 ` Herbert Euler
2006-11-28 14:13                   ` Herbert Euler
2006-11-28 15:31                     ` Miles Bader
2006-11-29  3:29                       ` Richard Stallman
2006-11-27  8:45       ` Lennart Borgman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=456AB431.4020103@gmx.at \
    --to=rudalics@gmx.at \
    --cc=bug-cc-mode@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=lennart.borgman.073@student.lu.se \
    --cc=miles@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.