From: Ivan Andrus <darthandrus@gmail.com>
To: 15415@debbugs.gnu.org
Subject: bug#15415: 24.3.50; c++-mode fontification for constructors is inconsistent
Date: Wed, 18 Sep 2013 20:44:39 -0600 [thread overview]
Message-ID: <C698CEA6-A017-4392-81E2-01E7C25528AE@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1143 bytes --]
Font locking of C++ constructors is somewhat inconsistent. This is no
doubt complicated by the fact that unlike other function declarations
they "don't have a return type".
When a single argument is not used but named, the constructor is not
fontified (normally it's fontified with `font-lock-function-name-face').
If the keyword explicit is used, then the argument type is fontified as
a variable, and the constructor name is fontified as a type. Perhaps
interestingly, naming the parameter or adding another parameter causes
fontification to work correctly (with or without explicit).
I have included a sample file below with comments on what I see in `emacs -q`
class Bob
{
// string is `font-lock-type-face', Bob is `font-lock-function-name-face'
Bob( string bob );
// string and Bob are not fontified (though I sometimes see string fontified as a type)
Bob( string );
// string is `font-lock-variable-name-face', Bob is `font-lock-type-face'
explicit Bob( string );
// string is `font-lock-type-face', Bob is `font-lock-function-name-face'
explicit Bob( string, string );
};
[-- Attachment #2: constructors.pdf --]
[-- Type: application/pdf, Size: 33105 bytes --]
[-- Attachment #3: Type: text/plain, Size: 1340 bytes --]
Thanks,
Ivan
In GNU Emacs 24.3.50.1 (i386-apple-darwin12.5.0, NS apple-appkit-1187.39)
of 2013-09-16 on ivanandres-MacBookPro
Bzr revision: 114309 rgm@gnu.org-20130916192145-tr5qrfdmhcq3a563
Windowing system distributor `Apple', version 10.3.1187
Configured using:
`configure --with-ns --with-xml2'
Important settings:
locale-coding-system: nil
default enable-multibyte-characters: t
Major mode: C++/lah
Minor modes in effect:
diff-auto-refine-mode: t
eldoc-mode: t
highlight-parentheses-mode: t
hl-sexp-mode: t
highlight-symbol-mode: t
which-function-mode: t
show-paren-mode: t
msb-mode: t
minibuffer-depth-indicate-mode: t
global-hl-line-mode: t
delete-selection-mode: t
auto-image-file-mode: t
auto-insert-mode: t
yas-global-mode: t
yas-minor-mode: t
shell-dirtrack-mode: t
ido-everywhere: t
global-visible-mark-mode: t
visible-mark-mode: t
gvol-mode: t
recentf-mode: t
desktop-save-mode: t
drag-stuff-global-mode: t
drag-stuff-mode: t
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
column-number-mode: t
line-number-mode: t
transient-mark-mode: t
abbrev-mode: t
next reply other threads:[~2013-09-19 2:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-19 2:44 Ivan Andrus [this message]
2013-09-30 3:31 ` bug#15415: 24.3.50; c++-mode fontification for constructors is inconsistent Ivan Andrus
2013-10-12 20:45 ` Alan Mackenzie
2013-10-18 22:00 ` Ivan Andrus
2013-10-19 15:18 ` Alan Mackenzie
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=C698CEA6-A017-4392-81E2-01E7C25528AE@gmail.com \
--to=darthandrus@gmail.com \
--cc=15415@debbugs.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.