emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#15573: closed (24.3.50; `comment-end' in c mode)


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#15573: closed (24.3.50; `comment-end' in c mode)
Date: Wed, 09 Oct 2013 18:18:02 +0000

Your message dated Wed, 09 Oct 2013 14:17:41 -0400
with message-id <address@hidden>
and subject line Re: bug#15573: 24.3.50; `comment-end' in c mode
has caused the debbugs.gnu.org bug report #15573,
regarding 24.3.50; `comment-end' in c mode
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
15573: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15573
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 24.3.50; `comment-end' in c mode Date: Wed, 9 Oct 2013 08:55:38 -0700 (PDT)
I don't work in C anymore, but I recently noticed that `comment-end' for
C mode seems to be " */", not "*/".  That presumably makes sense for the
use of `comment-end' as "String to insert to end a new comment.", per
the doc string.

But `comment-end' can also be used to recognize the end of a comment,
and in that case I would think that "*/", not " */", would be
appropriate for C.

Case in point: I have some code that does this:

(while (and (< start end) (setq cbeg  (comment-search-forward end 'NOERROR)))
  (setq cend  (if (string= "" comment-end)
                  (min (1+ (line-end-position)) (point-max))
                (search-forward comment-end end 'NOERROR)))
  (when (and cbeg cend)...))

But that fails to DTRT with a comment such as this, because `comment-end'
is not found:

/*
Some comment.
*/

So my question is whether `comment-end' should not perhaps be "*/" for C
code.

I do realize that `comment-skip' is available.  Perhaps I should just
use that somehow in my code, above?  Advice welcome.

I also see that there is `comment-padding', and that "the strings used
as comment ends are built from `comment-end' and `comment-padding'" (doc
string of `comment-region').  Perhaps `comment-end' should be "*/" and
`comment-padding' as " " should be used with it to do what is done now
using " */" as `comment-end' (and "" as `comment-padding')?

Presumably, since lots of people have been using this for a long time, I
just have something to learn wrt my code, above.  Again, please let me
know.  Thx.

In GNU Emacs 24.3.50.1 (i686-pc-mingw32)
 of 2013-09-30 on LEG570
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --enable-checking 'CFLAGS=-O0 -g3' CPPFLAGS=-DGLYPH_DEBUG=1'



--- End Message ---
--- Begin Message --- Subject: Re: bug#15573: 24.3.50; `comment-end' in c mode Date: Wed, 09 Oct 2013 14:17:41 -0400 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
> But `comment-end' can also be used to recognize the end of a comment,

No: that's what comment-end-skip is for.


        Stefan


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]