* bug#11865: 24.1.50; doxygen comments not highlighted in c++-mode
@ 2012-07-05 11:46 Toon Claes
2012-07-06 14:00 ` Toon Claes
` (2 more replies)
0 siblings, 3 replies; 15+ messages in thread
From: Toon Claes @ 2012-07-05 11:46 UTC (permalink / raw)
To: 11865; +Cc: toon
[-- Attachment #1: Type: text/plain, Size: 3487 bytes --]
I am using doxygen.org to comment code (and generate
documentation
from it). This requires a dedicated commenting style,
e.g.:
/**
* This is a doxygen comment
* @param par this is a
parameter for this function
* @return this is what is returned by the
function
*/
bool my_function(int par);
When this snippet is viewed
with major mode 'c-mode', the @-keywords are
highlighted. When you set
the major mode to 'c++-mode', this is not the
case.
So for some reason
this additional highlighting is not enabled for
c++. I am not sure if
this is a bug, or disabled on purpose. Anyhow,
using doxygen for c++ is
valid.
Also it seems the doxygen highlighting does not work when you
type
comments on the same line as the '/**', e.g. like this:
/** This
comment is not doxygen-highlighted
*/
Regards,
Toon
In GNU Emacs
24.1.50.1 (i686-suse-linux-gnu, X toolkit)
of 2012-06-20 on
suse12-tcl
Bzr revision: 108664
eggert@cs.ucla.edu-20120619185739-mile4zpnjrqz5e8e
Windowing system
distributor `The X.Org Foundation', version 11.0.11004000
Configured
using:
`configure '--without-toolkit-scroll-bars''
Important
settings:
value of $LC_CTYPE: en_US.UTF-8
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: @im=local
locale-coding-system: utf-8-unix
default enable-multibyte-characters: t
Major mode: C++/l
Minor modes
in effect:
tooltip-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t
abbrev-mode: t
Recent input:
C-x C-f <up> / t o
k <tab> s <tab> 2 <tab> T o <tab>
C o m <tab> O b <tab> O b <tab> S
<tab> m <tab> S <tab>
S r <backspace> <tab> <return> C-s r e b o o t
C-a
C-n C-n C-n M-x c + + m <backspace> - m o d e <return>
M-x f u
<backspace> <backspace> <help-echo> M-x r e
p o r t - <tab>
<return>
Recent messages:
For information about GNU Emacs and the GNU
system, type C-h C-a.
user-error: Beginning of history; no preceding
item
Making completion list...
Note: file is write protected
Loading
cc-langs...done
Mark saved where search started
completing-read-default:
Command attempted to use minibuffer while in minibuffer
Load-path
shadows:
None found.
Features:
(shadow sort gnus-util mail-extr
emacsbug message cl-macs format-spec
rfc822 mml mml-sec mm-decode
mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils
multi-isearch cc-langs cl macroexp cl-lib
cc-mode cc-fonts cc-guess
cc-menus cc-cmds cc-styles cc-align cc-engine
cc-vars cc-defs help-mode
easymenu view time-date tooltip ediff-hook
vc-hooks lisp-float-type
mwheel x-win x-dnd tool-bar dnd fontset image
regexp-opt fringe
tabulated-list newcomment lisp-mode register page
menu-bar rfn-eshadow
timer select scroll-bar mouse jit-lock font-lock
syntax facemenu
font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan
thai tai-viet lao korean japanese hebrew greek
romanian slovak czech
european ethiopic indian cyrillic chinese
case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs
button faces
cus-face files text-properties overlay sha1 md5 base64
format env
code-pages mule custom widget hashtable-print-readable
backquote
make-network-process dbusbind dynamic-setting
system-font-setting
font-render-setting x-toolkit x multi-tty emacs)
[-- Attachment #2: Type: text/html, Size: 4533 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#11865: 24.1.50; doxygen comments not highlighted in c++-mode
2012-07-05 11:46 bug#11865: 24.1.50; doxygen comments not highlighted in c++-mode Toon Claes
@ 2012-07-06 14:00 ` Toon Claes
2012-07-10 6:59 ` Toon Claes
2013-06-05 8:24 ` bug#11865: Fwd: " Toon Claes
2016-02-25 6:01 ` bug#11865: " Anders Lindgren
2 siblings, 1 reply; 15+ messages in thread
From: Toon Claes @ 2012-07-06 14:00 UTC (permalink / raw)
To: 11865
[-- Attachment #1: Type: text/plain, Size: 1947 bytes --]
I think I've found the solution. Please consider this patch:
===
modified file 'lisp/ChangeLog'
--- lisp/ChangeLog 2012-07-06 13:50:37
+0000
+++ lisp/ChangeLog 2012-07-06 07:08:10 +0000
@@ -1,11 +1,3
@@
-2012-07-06 Toon Claes <toon@tonotdo.com>
-
- * progmodes/cc-fonts.el
(gtkdoc-font-lock-keywords):
- Less restrictive checking for gtkdoc.
-
-
* progmodes/cc-vars.el: For c++-mode set gtkdoc the default
-
c-doc-comment-style.
-
2012-07-06 Glenn Morris <rgm@gnu.org>
*
Makefile.in (compile-one-process): Rename from "recompile".
===
modified file 'lisp/progmodes/cc-fonts.el'
---
lisp/progmodes/cc-fonts.el 2012-07-06 13:50:37 +0000
+++
lisp/progmodes/cc-fonts.el 2012-01-19 07:21:25 +0000
@@ -2572,7 +2572,7
@@
(defconst gtkdoc-font-lock-keywords
`((,(lambda (limit)
-
(c-font-lock-doc-comments "/\*\*\([^\*/].*\)?$" limit
+
(c-font-lock-doc-comments "/\*\*$" limit
gtkdoc-font-lock-doc-comments)
(c-font-lock-doc-comments "/\*< " limit
gtkdoc-font-lock-doc-protection)
=== modified file
'lisp/progmodes/cc-vars.el'
--- lisp/progmodes/cc-vars.el 2012-07-06
13:50:37 +0000
+++ lisp/progmodes/cc-vars.el 2012-02-11 22:13:29
+0000
@@ -552,8 +552,7 @@
(defcustom-c-stylevar c-doc-comment-style
'((java-mode . javadoc)
(pike-mode . autodoc)
- (c-mode . gtkdoc)
-
(c++-mode . gtkdoc))
+ (c-mode . gtkdoc))
"*Specifies documentation
comment style(s) to recognize.
This is primarily used to fontify doc
comments and the markup within
them, e.g. Javadoc comments.
@@ -563,7
+562,7 @@
javadoc -- Javadoc style for "/** ... */" comments (default
in Java mode).
autodoc -- Pike autodoc style for "//! ..." comments
(default in Pike mode).
- gtkdoc -- GtkDoc style for "/** ... **/"
comments (default in C/C++ mode).
+ gtkdoc -- GtkDoc style for "/** ...
**/" comments (default in C mode).
The value may also be a list of doc
comment styles, in which case all
of them are recognized simultaneously
(presumably with markup cues
[-- Attachment #2: Type: text/html, Size: 2958 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#11865: 24.1.50; doxygen comments not highlighted in c++-mode
2012-07-06 14:00 ` Toon Claes
@ 2012-07-10 6:59 ` Toon Claes
2016-02-24 6:29 ` Lars Ingebrigtsen
0 siblings, 1 reply; 15+ messages in thread
From: Toon Claes @ 2012-07-10 6:59 UTC (permalink / raw)
To: 11865; +Cc: toon
Excuse me, previous patch was incorrect. This one should be better
---
=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog 2012-07-06 07:08:10 +0000
+++ lisp/ChangeLog 2012-07-06 13:48:51 +0000
@@ -1,3 +1,11 @@
+2012-07-06 Toon Claes <toon@tonotdo.com>
+
+ * progmodes/cc-fonts.el (gtkdoc-font-lock-keywords):
+ Less restrictive checking for gtkdoc.
+
+ * progmodes/cc-vars.el: For c++-mode set gtkdoc the default
+ c-doc-comment-style.
+
2012-07-06 Glenn Morris <rgm@gnu.org>
* Makefile.in (compile-one-process): Rename from "recompile".
=== modified file 'lisp/progmodes/cc-fonts.el'
--- lisp/progmodes/cc-fonts.el 2012-01-19 07:21:25 +0000
+++ lisp/progmodes/cc-fonts.el 2012-07-06 13:49:00 +0000
@@ -2572,7 +2572,7 @@
(defconst gtkdoc-font-lock-keywords
`((,(lambda (limit)
- (c-font-lock-doc-comments "/\*\*$" limit
+ (c-font-lock-doc-comments "/\*\*\([^\*/].*\)?$" limit
gtkdoc-font-lock-doc-comments)
(c-font-lock-doc-comments "/\*< " limit
gtkdoc-font-lock-doc-protection)
=== modified file 'lisp/progmodes/cc-vars.el'
--- lisp/progmodes/cc-vars.el 2012-02-11 22:13:29 +0000
+++ lisp/progmodes/cc-vars.el 2012-07-06 13:48:46 +0000
@@ -552,7 +552,8 @@
(defcustom-c-stylevar c-doc-comment-style
'((java-mode . javadoc)
(pike-mode . autodoc)
- (c-mode . gtkdoc))
+ (c-mode . gtkdoc)
+ (c++-mode . gtkdoc))
"*Specifies documentation comment style(s) to recognize.
This is primarily used to fontify doc comments and the markup within
them, e.g. Javadoc comments.
@@ -562,7 +563,7 @@
javadoc -- Javadoc style for "/** ... */" comments (default in Java
mode).
autodoc -- Pike autodoc style for "//! ..." comments (default in Pike
mode).
- gtkdoc -- GtkDoc style for "/** ... **/" comments (default in C
mode).
+ gtkdoc -- GtkDoc style for "/** ... **/" comments (default in C/C++
mode).
The value may also be a list of doc comment styles, in which case all
of them are recognized simultaneously (presumably with markup cues
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#11865: 24.1.50; doxygen comments not highlighted in c++-mode
2012-07-10 6:59 ` Toon Claes
@ 2016-02-24 6:29 ` Lars Ingebrigtsen
0 siblings, 0 replies; 15+ messages in thread
From: Lars Ingebrigtsen @ 2016-02-24 6:29 UTC (permalink / raw)
To: Toon Claes; +Cc: 11865
Toon Claes <toon@tonotdo.com> writes:
> +2012-07-06 Toon Claes <toon@tonotdo.com>
> +
> + * progmodes/cc-fonts.el (gtkdoc-font-lock-keywords):
> + Less restrictive checking for gtkdoc.
> +
> + * progmodes/cc-vars.el: For c++-mode set gtkdoc the default
> + c-doc-comment-style.
> +
[...]
I am completely unfamiliar with the gtkdoc format, so I can't really
judge whether this makes sense or not. Anybody?
> === modified file 'lisp/progmodes/cc-fonts.el'
> --- lisp/progmodes/cc-fonts.el 2012-01-19 07:21:25 +0000
> +++ lisp/progmodes/cc-fonts.el 2012-07-06 13:49:00 +0000
> @@ -2572,7 +2572,7 @@
>
> (defconst gtkdoc-font-lock-keywords
> `((,(lambda (limit)
> - (c-font-lock-doc-comments "/\*\*$" limit
> + (c-font-lock-doc-comments "/\*\*\([^\*/].*\)?$" limit
> gtkdoc-font-lock-doc-comments)
> (c-font-lock-doc-comments "/\*< " limit
> gtkdoc-font-lock-doc-protection)
>
> === modified file 'lisp/progmodes/cc-vars.el'
> --- lisp/progmodes/cc-vars.el 2012-02-11 22:13:29 +0000
> +++ lisp/progmodes/cc-vars.el 2012-07-06 13:48:46 +0000
> @@ -552,7 +552,8 @@
> (defcustom-c-stylevar c-doc-comment-style
> '((java-mode . javadoc)
> (pike-mode . autodoc)
> - (c-mode . gtkdoc))
> + (c-mode . gtkdoc)
> + (c++-mode . gtkdoc))
> "*Specifies documentation comment style(s) to recognize.
> This is primarily used to fontify doc comments and the markup within
> them, e.g. Javadoc comments.
> @@ -562,7 +563,7 @@
>
> javadoc -- Javadoc style for "/** ... */" comments (default in Java
> mode).
> autodoc -- Pike autodoc style for "//! ..." comments (default in Pike
> mode).
> - gtkdoc -- GtkDoc style for "/** ... **/" comments (default in C
> mode).
> + gtkdoc -- GtkDoc style for "/** ... **/" comments (default in C/C++
> mode).
>
> The value may also be a list of doc comment styles, in which case all
> of them are recognized simultaneously (presumably with markup cues
>
>
>
>
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#11865: Fwd: Re: 24.1.50; doxygen comments not highlighted in c++-mode
2012-07-05 11:46 bug#11865: 24.1.50; doxygen comments not highlighted in c++-mode Toon Claes
2012-07-06 14:00 ` Toon Claes
@ 2013-06-05 8:24 ` Toon Claes
2016-02-26 3:37 ` Lars Ingebrigtsen
2016-02-25 6:01 ` bug#11865: " Anders Lindgren
2 siblings, 1 reply; 15+ messages in thread
From: Toon Claes @ 2013-06-05 8:24 UTC (permalink / raw)
To: 11865
Tags: patch
Resubmitting my patch (with correct "Tags: patch" this time) in hope it
finally gets merged.
---
=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog 2012-07-06 07:08:10 +0000
+++ lisp/ChangeLog 2012-07-06 13:48:51 +0000
@@ -1,3 +1,11 @@
+2012-07-06 Toon Claes <toon@tonotdo.com>
+
+ * progmodes/cc-fonts.el (gtkdoc-font-lock-keywords): Better gtkdoc
+ parsing.
+
+ * progmodes/cc-vars.el (c-doc-comment-style): Use gtkdoc as default
+ for C++.
+
2012-07-06 Glenn Morris <rgm@gnu.org>
* Makefile.in (compile-one-process): Rename from "recompile".
=== modified file 'lisp/progmodes/cc-fonts.el'
--- lisp/progmodes/cc-fonts.el 2012-01-19 07:21:25 +0000
+++ lisp/progmodes/cc-fonts.el 2012-07-06 13:49:00 +0000
@@ -2572,7 +2572,7 @@
(defconst gtkdoc-font-lock-keywords
`((,(lambda (limit)
- (c-font-lock-doc-comments "/**$" limit
+ (c-font-lock-doc-comments "/**([^*/].*)?$" limit
gtkdoc-font-lock-doc-comments)
(c-font-lock-doc-comments "/*< " limit
gtkdoc-font-lock-doc-protection)
=== modified file 'lisp/progmodes/cc-vars.el'
--- lisp/progmodes/cc-vars.el 2012-02-11 22:13:29 +0000
+++ lisp/progmodes/cc-vars.el 2012-07-06 13:48:46 +0000
@@ -552,7 +552,8 @@
(defcustom-c-stylevar c-doc-comment-style
'((java-mode . javadoc)
(pike-mode . autodoc)
- (c-mode . gtkdoc))
+ (c-mode . gtkdoc)
+ (c++-mode . gtkdoc))
"*Specifies documentation comment style(s) to recognize.
This is primarily used to fontify doc comments and the markup within
them, e.g. Javadoc comments.
@@ -562,7 +563,7 @@
javadoc -- Javadoc style for "/** ... */" comments (default in Java
mode).
autodoc -- Pike autodoc style for "//! ..." comments (default in Pike
mode).
- gtkdoc -- GtkDoc style for "/** ... **/" comments (default in C
mode).
+ gtkdoc -- GtkDoc style for "/** ... **/" comments (default in C/C++
mode).
The value may also be a list of doc comment styles, in which case all
of them are recognized simultaneously (presumably with markup cues
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#11865: Fwd: Re: 24.1.50; doxygen comments not highlighted in c++-mode
2013-06-05 8:24 ` bug#11865: Fwd: " Toon Claes
@ 2016-02-26 3:37 ` Lars Ingebrigtsen
2016-02-26 8:03 ` Toon Claes
0 siblings, 1 reply; 15+ messages in thread
From: Lars Ingebrigtsen @ 2016-02-26 3:37 UTC (permalink / raw)
To: Toon Claes; +Cc: 11865
Toon Claes <toon@tonotdo.com> writes:
> (defconst gtkdoc-font-lock-keywords
> `((,(lambda (limit)
> - (c-font-lock-doc-comments "/**$" limit
> + (c-font-lock-doc-comments "/**([^*/].*)?$" limit
Can this be correct, though? It would mean that /** foo / **/ wouldn't
be a comment... and anyway, the /** is invalid as a regexp, anyway.
The current code looks like
(defconst gtkdoc-font-lock-keywords
`((,(lambda (limit)
(c-font-lock-doc-comments "/\\*\\*$" limit
gtkdoc-font-lock-doc-comments)
(c-font-lock-doc-comments "/\\*< " limit
gtkdoc-font-lock-doc-protection)
))))
Which looks more correct anyway. So I think this has already been fixed
in a different manner, and I'm closing this bug report.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#11865: Fwd: Re: 24.1.50; doxygen comments not highlighted in c++-mode
2016-02-26 3:37 ` Lars Ingebrigtsen
@ 2016-02-26 8:03 ` Toon Claes
2016-02-27 4:04 ` Lars Ingebrigtsen
0 siblings, 1 reply; 15+ messages in thread
From: Toon Claes @ 2016-02-26 8:03 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Toon Claes, 11865
[-- Attachment #1: Type: text/plain, Size: 1428 bytes --]
Hi,
I do not really agree.
Let me explain in detail.
Only comment blocks like the following were recognized as gtkdoc:
/**
* This is the gtkdoc comment
*/
I wanted also gtkdoc styling to be applied to:
/** This should be gtkdoc comment too */
I admit, the regexp I wrote back in the day was not correctly escaped.
But I was trying to achieve comments with 3 or more asterisks would not get styled like gtkdoc comments.
Gr,
Toon
> On 26 Feb 2016, at 04:37, Lars Ingebrigtsen <larsi@gnus.org> wrote:
>
> Toon Claes <toon@tonotdo.com> writes:
>
>> (defconst gtkdoc-font-lock-keywords
>> `((,(lambda (limit)
>> - (c-font-lock-doc-comments "/**$" limit
>> + (c-font-lock-doc-comments "/**([^*/].*)?$" limit
>
> Can this be correct, though? It would mean that /** foo / **/ wouldn't
> be a comment... and anyway, the /** is invalid as a regexp, anyway.
>
> The current code looks like
>
> (defconst gtkdoc-font-lock-keywords
> `((,(lambda (limit)
> (c-font-lock-doc-comments "/\\*\\*$" limit
> gtkdoc-font-lock-doc-comments)
> (c-font-lock-doc-comments "/\\*< " limit
> gtkdoc-font-lock-doc-protection)
> ))))
>
> Which looks more correct anyway. So I think this has already been fixed
> in a different manner, and I'm closing this bug report.
>
> --
> (domestic pets only, the antidote for overdose, milk.)
> bloggy blog: http://lars.ingebrigtsen.no
[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 842 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#11865: Fwd: Re: 24.1.50; doxygen comments not highlighted in c++-mode
2016-02-26 8:03 ` Toon Claes
@ 2016-02-27 4:04 ` Lars Ingebrigtsen
2016-03-10 8:58 ` Toon Claes
0 siblings, 1 reply; 15+ messages in thread
From: Lars Ingebrigtsen @ 2016-02-27 4:04 UTC (permalink / raw)
To: Toon Claes; +Cc: Toon Claes, 11865
Toon Claes <toon@iotcl.com> writes:
> I do not really agree.
>
> Let me explain in detail.
> Only comment blocks like the following were recognized as gtkdoc:
> /**
> * This is the gtkdoc comment
> */
>
> I wanted also gtkdoc styling to be applied to:
> /** This should be gtkdoc comment too */
>
> I admit, the regexp I wrote back in the day was not correctly escaped.
> But I was trying to achieve comments with 3 or more asterisks would
> not get styled like gtkdoc comments.
Can you supply a patch that will give the correct styling?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#11865: Fwd: Re: 24.1.50; doxygen comments not highlighted in c++-mode
2016-02-27 4:04 ` Lars Ingebrigtsen
@ 2016-03-10 8:58 ` Toon Claes
2019-06-27 15:10 ` Lars Ingebrigtsen
0 siblings, 1 reply; 15+ messages in thread
From: Toon Claes @ 2016-03-10 8:58 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Toon Claes, 11865
[-- Attachment #1.1: Type: text/plain, Size: 151 bytes --]
Hi Lars,
Find the patch attached.
The regexp is written to match:
/** gtkdoc */
/**
* gtkdoc
*/
And to not match:
/*******/
Kind regards,
Toon
[-- Attachment #1.2: 0001-Fix-Bug-11865.patch --]
[-- Type: application/octet-stream, Size: 2673 bytes --]
From 94c9c1c92f326de5e813780f8230f1ae3d4a6e96 Mon Sep 17 00:00:00 2001
From: Toon Claes <toon@iotcl.com>
Date: Thu, 10 Mar 2016 09:38:11 +0100
Subject: [PATCH] Fix Bug#11865
* progmodes/cc-vars.el (c-doc-comment-style): Set gtkdoc the
default for c++-mode.
* progmodes/cc-fonts.el (gtkdoc-font-lock-keywords): Text inside
GtkDoc comment can be on the same line as the comment start "/**".
---
ChangeLog.2 | 9 +++++++++
lisp/progmodes/cc-fonts.el | 2 +-
lisp/progmodes/cc-vars.el | 5 +++--
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/ChangeLog.2 b/ChangeLog.2
index 5253a92..7ba1872 100644
--- a/ChangeLog.2
+++ b/ChangeLog.2
@@ -1,3 +1,12 @@
+2016-03-10 Toon Claes <toon@iotcl.com>
+
+ Fix Bug#11865
+
+ * progmodes/cc-vars.el (c-doc-comment-style): Set gtkdoc the
+ default for c++-mode.
+ * progmodes/cc-fonts.el (gtkdoc-font-lock-keywords): Text inside
+ GtkDoc comment can be on the same line as the comment start "/**".
+
2016-03-04 Michael Albinus <michael.albinus@gmx.de>
Fix Bug#22859
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index a7097b9..6bbb8f4 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -2515,7 +2515,7 @@ need for `pike-font-lock-extra-types'.")
(defconst gtkdoc-font-lock-keywords
`((,(lambda (limit)
- (c-font-lock-doc-comments "/\\*\\*$" limit
+ (c-font-lock-doc-comments "/\\*\\*\\([^\\*].*\\)?$" limit
gtkdoc-font-lock-doc-comments)
(c-font-lock-doc-comments "/\\*< " limit
gtkdoc-font-lock-doc-protection)
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
index a695718..9783516 100644
--- a/lisp/progmodes/cc-vars.el
+++ b/lisp/progmodes/cc-vars.el
@@ -550,7 +550,8 @@ variable in a mode hook."
(defcustom-c-stylevar c-doc-comment-style
'((java-mode . javadoc)
(pike-mode . autodoc)
- (c-mode . gtkdoc))
+ (c-mode . gtkdoc)
+ (c++-mode . gtkdoc))
"*Specifies documentation comment style(s) to recognize.
This is primarily used to fontify doc comments and the markup within
them, e.g. Javadoc comments.
@@ -560,7 +561,7 @@ comment styles:
javadoc -- Javadoc style for \"/** ... */\" comments (default in Java mode).
autodoc -- Pike autodoc style for \"//! ...\" comments (default in Pike mode).
- gtkdoc -- GtkDoc style for \"/** ... **/\" comments (default in C mode).
+ gtkdoc -- GtkDoc style for \"/** ... **/\" comments (default in C/C++ mode).
The value may also be a list of doc comment styles, in which case all
of them are recognized simultaneously (presumably with markup cues
--
2.7.1
[-- Attachment #1.3: Type: text/plain, Size: 751 bytes --]
> On 27 Feb 2016, at 05:04, Lars Ingebrigtsen <larsi@gnus.org> wrote:
>
> Toon Claes <toon@iotcl.com> writes:
>
>> I do not really agree.
>>
>> Let me explain in detail.
>> Only comment blocks like the following were recognized as gtkdoc:
>> /**
>> * This is the gtkdoc comment
>> */
>>
>> I wanted also gtkdoc styling to be applied to:
>> /** This should be gtkdoc comment too */
>>
>> I admit, the regexp I wrote back in the day was not correctly escaped.
>> But I was trying to achieve comments with 3 or more asterisks would
>> not get styled like gtkdoc comments.
>
> Can you supply a patch that will give the correct styling?
>
> --
> (domestic pets only, the antidote for overdose, milk.)
> bloggy blog: http://lars.ingebrigtsen.no
[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 842 bytes --]
^ permalink raw reply related [flat|nested] 15+ messages in thread
* bug#11865: Fwd: Re: 24.1.50; doxygen comments not highlighted in c++-mode
2016-03-10 8:58 ` Toon Claes
@ 2019-06-27 15:10 ` Lars Ingebrigtsen
2019-06-28 9:19 ` Alan Mackenzie
2019-06-30 15:13 ` Alan Mackenzie
0 siblings, 2 replies; 15+ messages in thread
From: Lars Ingebrigtsen @ 2019-06-27 15:10 UTC (permalink / raw)
To: Alan Mackenzie; +Cc: Toon Claes, Toon Claes, 11865
Toon Claes <toon@iotcl.com> writes:
> Hi Lars,
>
> Find the patch attached.
> The regexp is written to match:
> /** gtkdoc */
> /**
> * gtkdoc
> */
>
> And to not match:
> /*******/
Alan, can you comment on this patch? It's about not recognising gtkdoc
comments in c++-mode:
> * progmodes/cc-vars.el (c-doc-comment-style): Set gtkdoc the
> default for c++-mode.
> * progmodes/cc-fonts.el (gtkdoc-font-lock-keywords): Text inside
> GtkDoc comment can be on the same line as the comment start "/**".
> ---
> ChangeLog.2 | 9 +++++++++
> lisp/progmodes/cc-fonts.el | 2 +-
> lisp/progmodes/cc-vars.el | 5 +++--
> 3 files changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/ChangeLog.2 b/ChangeLog.2
> index 5253a92..7ba1872 100644
> --- a/ChangeLog.2
> +++ b/ChangeLog.2
> @@ -1,3 +1,12 @@
> +2016-03-10 Toon Claes <toon@iotcl.com>
> +
> + Fix Bug#11865
> +
> + * progmodes/cc-vars.el (c-doc-comment-style): Set gtkdoc the
> + default for c++-mode.
> + * progmodes/cc-fonts.el (gtkdoc-font-lock-keywords): Text inside
> + GtkDoc comment can be on the same line as the comment start "/**".
> +
> 2016-03-04 Michael Albinus <michael.albinus@gmx.de>
>
> Fix Bug#22859
> diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
> index a7097b9..6bbb8f4 100644
> --- a/lisp/progmodes/cc-fonts.el
> +++ b/lisp/progmodes/cc-fonts.el
> @@ -2515,7 +2515,7 @@ need for `pike-font-lock-extra-types'.")
>
> (defconst gtkdoc-font-lock-keywords
> `((,(lambda (limit)
> - (c-font-lock-doc-comments "/\\*\\*$" limit
> + (c-font-lock-doc-comments "/\\*\\*\\([^\\*].*\\)?$" limit
> gtkdoc-font-lock-doc-comments)
> (c-font-lock-doc-comments "/\\*< " limit
> gtkdoc-font-lock-doc-protection)
> diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
> index a695718..9783516 100644
> --- a/lisp/progmodes/cc-vars.el
> +++ b/lisp/progmodes/cc-vars.el
> @@ -550,7 +550,8 @@ variable in a mode hook."
> (defcustom-c-stylevar c-doc-comment-style
> '((java-mode . javadoc)
> (pike-mode . autodoc)
> - (c-mode . gtkdoc))
> + (c-mode . gtkdoc)
> + (c++-mode . gtkdoc))
> "*Specifies documentation comment style(s) to recognize.
> This is primarily used to fontify doc comments and the markup within
> them, e.g. Javadoc comments.
> @@ -560,7 +561,7 @@ comment styles:
>
> javadoc -- Javadoc style for \"/** ... */\" comments (default in Java mode).
> autodoc -- Pike autodoc style for \"//! ...\" comments (default in Pike mode).
> - gtkdoc -- GtkDoc style for \"/** ... **/\" comments (default in C mode).
> + gtkdoc -- GtkDoc style for \"/** ... **/\" comments (default in C/C++ mode).
>
> The value may also be a list of doc comment styles, in which case all
> of them are recognized simultaneously (presumably with markup cues
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#11865: Fwd: Re: 24.1.50; doxygen comments not highlighted in c++-mode
2019-06-27 15:10 ` Lars Ingebrigtsen
@ 2019-06-28 9:19 ` Alan Mackenzie
2019-06-30 15:13 ` Alan Mackenzie
1 sibling, 0 replies; 15+ messages in thread
From: Alan Mackenzie @ 2019-06-28 9:19 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Toon Claes, Toon Claes, 11865
Hello, Lars.
On Thu, Jun 27, 2019 at 17:10:05 +0200, Lars Ingebrigtsen wrote:
> Toon Claes <toon@iotcl.com> writes:
> > Hi Lars,
> > Find the patch attached.
> > The regexp is written to match:
> > /** gtkdoc */
> > /**
> > * gtkdoc
> > */
> > And to not match:
> > /*******/
> Alan, can you comment on this patch? It's about not recognising gtkdoc
> comments in c++-mode:
Thanks for the reminder.
I'm a bit busy in RL at the moment, but I should be able to look at it
sometime in the next week or two.
[ .... ]
> --
> (domestic pets only, the antidote for overdose, milk.)
> bloggy blog: http://lars.ingebrigtsen.no
--
Alan Mackenzie (Nuremberg, Germany).
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#11865: Fwd: Re: 24.1.50; doxygen comments not highlighted in c++-mode
2019-06-27 15:10 ` Lars Ingebrigtsen
2019-06-28 9:19 ` Alan Mackenzie
@ 2019-06-30 15:13 ` Alan Mackenzie
2019-07-01 7:49 ` Toon Claes
1 sibling, 1 reply; 15+ messages in thread
From: Alan Mackenzie @ 2019-06-30 15:13 UTC (permalink / raw)
To: Lars Ingebrigtsen, Toon Claes, Toon Claes; +Cc: 11865
Hello, Toon and Lars.
On Thu, Jun 27, 2019 at 17:10:05 +0200, Lars Ingebrigtsen wrote:
> Toon Claes <toon@iotcl.com> writes:
> > Hi Lars,
> > Find the patch attached.
> > The regexp is written to match:
> > /** gtkdoc */
> > /**
> > * gtkdoc
> > */
> > And to not match:
> > /*******/
> Alan, can you comment on this patch? It's about not recognising gtkdoc
> comments in c++-mode:
I've just had a close look at this, and it's the least controversial
patch I've seen in years. There is simply nothing in it which raises the
slightest question as to it's being a good thing.
So I've committed the change. If I don't hear anything back within a few
days, I'll assume the change successful and close the bug.
> > * progmodes/cc-vars.el (c-doc-comment-style): Set gtkdoc the
> > default for c++-mode.
> > * progmodes/cc-fonts.el (gtkdoc-font-lock-keywords): Text inside
> > GtkDoc comment can be on the same line as the comment start "/**".
> > ---
> > ChangeLog.2 | 9 +++++++++
> > lisp/progmodes/cc-fonts.el | 2 +-
> > lisp/progmodes/cc-vars.el | 5 +++--
> > 3 files changed, 13 insertions(+), 3 deletions(-)
> --
> (domestic pets only, the antidote for overdose, milk.)
> bloggy blog: http://lars.ingebrigtsen.no
--
Alan Mackenzie (Nuremberg, Germany).
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#11865: Fwd: Re: 24.1.50; doxygen comments not highlighted in c++-mode
2019-06-30 15:13 ` Alan Mackenzie
@ 2019-07-01 7:49 ` Toon Claes
2019-07-03 2:36 ` Basil L. Contovounesios
0 siblings, 1 reply; 15+ messages in thread
From: Toon Claes @ 2019-07-01 7:49 UTC (permalink / raw)
To: Alan Mackenzie; +Cc: Toon Claes, Lars Ingebrigtsen, 11865
[-- Attachment #1: Type: text/plain, Size: 308 bytes --]
close 11865
thanks
Alan Mackenzie <acm@muc.de> writes:
> So I've committed the change. If I don't hear anything back within a few
> days, I'll assume the change successful and close the bug.
Thanks. I'm no longer typing C++, but I think there still will people be
happy with this.
--
Toon
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#11865: Fwd: Re: 24.1.50; doxygen comments not highlighted in c++-mode
2019-07-01 7:49 ` Toon Claes
@ 2019-07-03 2:36 ` Basil L. Contovounesios
0 siblings, 0 replies; 15+ messages in thread
From: Basil L. Contovounesios @ 2019-07-03 2:36 UTC (permalink / raw)
To: Toon Claes; +Cc: Toon Claes, Alan Mackenzie, Lars Ingebrigtsen, 11865-done
tags 11865 fixed
close 11865 27.1
quit
Toon Claes <toon@iotcl.com> writes:
> close 11865
> thanks
This didn't seem to close the bug (perhaps you forgot to Bcc
control@debbugs.gnu.org), so I'm doing that now.
Thanks,
--
Basil
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#11865: 24.1.50; doxygen comments not highlighted in c++-mode
2012-07-05 11:46 bug#11865: 24.1.50; doxygen comments not highlighted in c++-mode Toon Claes
2012-07-06 14:00 ` Toon Claes
2013-06-05 8:24 ` bug#11865: Fwd: " Toon Claes
@ 2016-02-25 6:01 ` Anders Lindgren
2 siblings, 0 replies; 15+ messages in thread
From: Anders Lindgren @ 2016-02-25 6:01 UTC (permalink / raw)
To: 11865, Lars Ingebrigtsen
[-- Attachment #1: Type: text/plain, Size: 395 bytes --]
The changes looks OK. However, the "gtk" format is only a subset of the
Doxygen format.
For example, doxygen can use "\command" as well as "@command". Also, "//!"
or "/*!" can start a doxygen comment.
(As I side note, I have a back burner project implementing highlighting for
doxygen comments. However, it's been stalled due to problems with
installing custom c-doc packages.)
-- Anders
[-- Attachment #2: Type: text/html, Size: 571 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2019-07-03 2:36 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-05 11:46 bug#11865: 24.1.50; doxygen comments not highlighted in c++-mode Toon Claes
2012-07-06 14:00 ` Toon Claes
2012-07-10 6:59 ` Toon Claes
2016-02-24 6:29 ` Lars Ingebrigtsen
2013-06-05 8:24 ` bug#11865: Fwd: " Toon Claes
2016-02-26 3:37 ` Lars Ingebrigtsen
2016-02-26 8:03 ` Toon Claes
2016-02-27 4:04 ` Lars Ingebrigtsen
2016-03-10 8:58 ` Toon Claes
2019-06-27 15:10 ` Lars Ingebrigtsen
2019-06-28 9:19 ` Alan Mackenzie
2019-06-30 15:13 ` Alan Mackenzie
2019-07-01 7:49 ` Toon Claes
2019-07-03 2:36 ` Basil L. Contovounesios
2016-02-25 6:01 ` bug#11865: " Anders Lindgren
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).