unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#15211: 24.3.50; Incorrect fontification in c++-mode
@ 2013-08-29 20:48 Ivan Andrus
  2013-08-31 20:56 ` Alan Mackenzie
  2013-09-18 20:53 ` Alan Mackenzie
  0 siblings, 2 replies; 6+ messages in thread
From: Ivan Andrus @ 2013-08-29 20:48 UTC (permalink / raw)
  To: 15211

In C and C++ it is legal to place the const to the right of the type as below:

Json parseJson( string const &json );

However, this results in "string" not being fontified as a type
(i.e. with `font-lock-type-face').  It seems to work some times, but the
minimal example above does not when starting from `emacs -q`.

Although this is fairly uncommon, there are valid reasons for doing this
(see http://www.dansaks.com/articles/1999-02%20const%20T%20vs%20T%20const.pdf
for example), and at work it's ubiquitous.  The lack of fontification is
annoying since it gives me vi envy. :-)

Thanks for the overall excellent cc-mode(s)!

-Ivan


In GNU Emacs 24.3.50.5 (i386-apple-darwin12.4.0, NS apple-appkit-1187.39)
of 2013-08-23 on ivanandres-MacBookPro
Bzr revision: 113987 eggert@cs.ucla.edu-20130824022334-kloqiv3hqimcrnmg
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:
  jabber-activity-mode: t
  semantic-minor-modes-format: ((:eval (if (or semantic-highlight-edits-mode semantic-show-unmatched-syntax-mode semantic-idle-scheduler-mode)  S)))
  doxymacs-mode: t
  diff-auto-refine-mode: t
  eldoc-mode: t
  highlight-parentheses-mode: t
  hl-sexp-mode: t
  highlight-symbol-mode: t
  TeX-PDF-mode: t
  which-function-mode: t
  show-paren-mode: t
  global-semantic-stickyfunc-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
  command-frequency-autosave-mode: t
  command-frequency-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

Recent input:
TAB TAB TAB TAB C-k C-c C-f TAB TAB TAB TAB TAB C-x
r j o C-x r j n <C-return> G e t SPC u s SPC o f f
TAB TAB <C-S-backspace> <C-S-backspace> C-e SPC o f
SPC t h e SPC a l a r m SPC s y s t e m <M-down> <M-down>
<M-down> <M-down> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <up> <up> C-x C-s C-e ? <up> <up> <up> <tab>
<left> <tab> <C-S-backspace> C-x C-s <up> <S-right>
e C-/ C-e <S-right> <S-right> C-x C-s <down> <down>
<down> <down> <down> <down> C-a M-c <down> C-x C-s
<down> <down> <down> <down> <down> <up> <up> <up> <up>
s-h M-W M-W C-k C-k C-k C-k C-k TAB TAB TAB TAB TAB
TAB TAB TAB TAB M-k M-k M-k M-k C-y j s r l : : J s
o n SPC p a r s e J s o n , , SPC c o n s t SPC s t
r i n g C-M-j C-M-t SPC & SPC j s o n SPC C-e { C-y
} TAB TAB TAB C-o C-o C-o C-u C-M-k C-/ C-M-l C-M-k
C-l C-M-k C-/ C-l C-d C-e C-SPC TAB C-e C-SPC <up>
<down> <M-down> C-e <C-backspace> t m p C-k C-l C-a
C-M-l C-M-k C-M-l <C-backspace> t m p C-e <return>
r e t u r n SPC t m p ; C-x C-s } C-M-j C-M-u C-M-l
C-SPC C-SPC C-M-j C-M-SPC C-M-l <tab> <tab> TAB C-M-SPC
<tab> C-x C-s TAB TAB TAB TAB TAB C-e C-M-j C-a M-k
C-y TAB M-k C-/ C-3 C-x b C-y TAB C-e C-u C-SPC C-x
C-s C-g C-a C-M-k C-d C-d C-k TAB M-k C-y C-SPC C-SPC
) ; C-x C-s C-g TAB M-k C-/ M-x r e <return>

Recent messages:
Error during redisplay: (eval (let ((glob-str (mapconcat (function eval) global-mode-string "")) (global-string (mapconcat (function eval) global-mode-string " "))) (when (> (length glob-str) 0) (concat (propertize " " (quote display) (\` ((space :align-to (- right-fringe (\, (+ (length global-string) 5)))))) (quote help-echo) "mouse-1: Select (drag to resize)
mouse-2: Make current window occupy the whole frame
mouse-3: Remove current window from display") (propertize " " (quote display) arrow-right-3) (propertize global-string (quote face) (quote mode-line-buffer-id)) #(" " 0 1 (help-echo "mouse-1: Select (drag to resize)
mouse-2: Make current window occupy the whole frame
mouse-3: Remove current window from display" face mode-line-buffer-id)) (propertize " " (quote display) arrow-right-4))))) signaled (void-function t)
Error during redisplay: (eval (let ((glob-str (mapconcat (function eval) global-mode-string "")) (global-string (mapconcat (function eval) global-mode-string " "))) (when (> (length glob-str) 0) (concat (propertize " " (quote display) (\` ((space :align-to (- right-fringe (\, (+ (length global-string) 5)))))) (quote help-echo) "mouse-1: Select (drag to resize)
mouse-2: Make current window occupy the whole frame
mouse-3: Remove current window from display") (propertize " " (quote display) arrow-right-3) (propertize global-string (quote face) (quote mode-line-buffer-id)) #(" " 0 1 (help-echo "mouse-1: Select (drag to resize)
mouse-2: Make current window occupy the whole frame
mouse-3: Remove current window from display" face mode-line-buffer-id)) (propertize " " (quote display) arrow-right-4))))) signaled (void-function t)

Load-path shadows:
/Users/ivanandres/.emacs.d/elpa/magit-20130828.1540/.dir-locals hides /Users/ivanandres/vcs/sage-mode/emacs/.dir-locals
~/vcs/emacs-clang-complete-async/auto-complete-clang-async hides /Users/ivanandres/.emacs.d/elpa/auto-complete-clang-async-20130526.2314/auto-complete-clang-async
/Users/ivanandres/.emacs.d/elpa/confluence-20130814.735/confluence-edit hides /Users/ivanandres/.emacs.d/elpa/confluence-edit-20130804.2241/confluence-edit
/Users/ivanandres/.emacs.d/elpa/magit-20130828.1540/.dir-locals hides /Users/ivanandres/.emacs.d/elpa/highlight-parentheses-20130523.1752/.dir-locals
/Users/ivanandres/.emacs.d/elpa/magit-20130828.1540/.dir-locals hides /Users/ivanandres/.emacs.d/elpa/highlight-symbol-20130628.1552/.dir-locals
/Users/ivanandres/.emacs.d/elpa/php+-mode-20121129.1452/string-utils hides /Users/ivanandres/.emacs.d/elpa/string-utils-20121108.1917/string-utils
/Users/ivanandres/.emacs.d/elpa/jira-20091012.2123/jira hides ~/.emacs.d/local/jira
/Users/ivanandres/.emacs.d/elpa/magit-20130828.1540/.dir-locals hides /Users/ivanandres/vcs/emacs/local/nextstep/Emacs.app/Contents/Resources/lisp/gnus/.dir-locals

Features:
(shadow emacsbug message rfc822 mml mml-sec mm-decode mm-bodies
mm-encode mailabbrev gmm-utils mailheader sendmail compare-w pcase
jabber-libnotify jabber-awesome jabber-osd jabber-wmii jabber-xmessage
jabber-festival jabber-sawfish jabber-ratpoison jabber-tmux
jabber-screen jabber-socks5 jabber-ft-server jabber-ft-client
jabber-truncate jabber-time jabber-vcard-avatars jabber-chatstates
jabber-events jabber-vcard jabber-activity jabber-watch jabber-modeline
jabber-ahc-presence jabber-version jabber-browse jabber-search
jabber-roster jabber-ourversion jabber-avatar jabber-autoaway
jabber-register jabber-presence dbus jabber-ping jabber-si-server
jabber-ft-common jabber-si-client jabber-si-common jabber-feature-neg
jabber-private jabber-ahc jabber-muc-nick-completion hippie-exp
jabber-muc jabber-muc-nick-coloring hexrgb jabber-newdisco jabber-widget
jabber-disco jabber-iq jabber-chat jabber-menu jabber-history
jabber-chatbuffer jabber-alert jabber-core jabber-console sgml-mode
jabber-keymap jabber-sasl sasl sasl-anonymous sasl-login sasl-plain fsm
jabber-conn srv dns gnutls jabber-logon jabber-xml jabber-util
ecb-symboldef ecb-analyse ecb-compatibility ecb-winman-support
ecb-autogen ecb-tod ecb-cycle ecb-eshell ecb-help ecb-jde ecb-upgrade
ecb-file-browser ecb-method-browser ecb-semantic-wrapper ecb-semantic
ecb-speedbar ecb-layout ecb-create-layout ecb-compilation
ecb-common-browser ecb-navigate ecb-cedet-wrapper semantic/analyze
semantic/scope semantic/analyze/fcn ecb-mode-line ecb-face tree-buffer
ecb-util silentcomp find-lisp magit-cherry magit-bisect magit-key-mode
magit iswitchb esh-var esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg
esh-groups eshell esh-module esh-mode esh-util ediff-merg ediff-wind
ediff-diff ediff-mult ediff-help ediff-init ediff-util ediff
magit-compat mc-separate-operations rectangular-region-mode mc-mark-pop
mc-mark-more mc-cycle-cursors css-eldoc-hash-table autoload lisp-mnt
tar-mode finder-inf mark-more-like-this mark-multiple mc-edit-lines
multiple-cursors-core warnings shell-toggle sql view rot13 disp-table
mail-extr org-colview yaml-mode json-mode sort mail-utils network-stream
starttls url-cache find-file phi-search vcursor repeat js json
goto-last-change debug browse-url url-handlers url-http tls url-auth
mail-parse rfc2231 rfc2047 rfc2045 ietf-drums url-gw calc-aent calc-yank
calc-misc calc-alg calc-menu calc-ext calc calc-loaddefs calc-macs
org-table epa-file epa derived conf-mode vc-annotate log-view wgrep-ack
wgrep ack-and-a-half grep ibuf-ext ibuffer git-rebase-mode ruler-mode
hexl dired+ dired-x dired-aux dired ruby-mode git-commit-mode skeleton
etags-select etags ffap tramp-cache tramp-sh dabbrev vc-bzr vc-svn
vc-cvs vc-dir ewoc smerge-mode epg epg-config mule-util cal-move
parse-time superword subword artist picture reporter rect org-element
diff-mode diff nxml-uchnm rng-xsd xsd-regexp rng-cmpct rng-nxml
rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util
rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap nxml-util nxml-glyph
nxml-enc xmltok misearch multi-isearch semantic/imenu semantic/sb
semantic/sort semantic/db-file data-debug cedet-files
semantic/wisent/python semantic/db-mode semantic/decorate/include
semantic/db-find semantic/db-ref semantic/decorate/mode
semantic/decorate pulse sage-view semantic/dep semantic/wisent/python-wy
semantic/wisent semantic/wisent/wisent sage-mode apropos sage-compat
hideshow python sh-script smie executable elide-head ede/cpp-root
ede/generic ede/shell eieio-opt ede/speedbar ede/files ede ede/base
ede/auto ede/source eieio-speedbar speedbar sb-image dframe eieio-custom
semantic/db eieio-base vc-git c-eldoc tempo url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf url-util
url-parse url-vars mailcap xml-parse doxymacs cc-langs info-look cc-mode
cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars
cc-defs eldoc highlight-parentheses greedy-delete hl-sexp
highlight-symbol thingatpt gvol-light-theme tabify cal-iso org-mobile
reveal org-mouse org-irc org-habit org-jsinfo org-infojs org-html
org-info org-gnus org-docview org-ctags org-bibtex bibtex org-bbdb
org-archive org-id vc-hg tex-fold reftex-dcr reftex-auc reftex
reftex-vars tex-bar toolbar-x font-latex latex edmacro kmacro tex-style
sage-latex org-latex org-export-latex org-beamer footnote org-crypt
ob-python org-clock org-exp ob-exp org-exp-blocks org-agenda org
ob-tangle ob-ref ob-lob ob-table org-footnote org-src ob-comint ob-keys
org-pcomplete org-list org-faces org-entities noutline outline
org-version ob-emacs-lisp ob org-compat org-macs ob-eval org-loaddefs
find-func tex-buf tex crm time uniquify saveplace semantic/idle
semantic/format ezimage semantic/tag-ls semantic/find semantic/ctxt
which-func imenu paren semantic/util-modes semantic/util semantic
semantic/tag semantic/lex semantic/fw mode-local cedet msb mb-depth
icomplete hl-line delsel image-file cus-start cus-load diary-lib
diary-loaddefs cal-menu calendar cal-loaddefs autoinsert yasnippet
help-mode tramp tramp-compat auth-source eieio byte-opt bytecomp
byte-compile cconv eieio-core gnus-util mm-util mail-prsvr
password-cache tramp-loaddefs trampver shell pcomplete format-spec smex
ido visible-mark parenface fold commit-patch-buffer log-edit pcvs-util
add-log vc vc-dispatcher sage sage-load jka-compr recentf tree-widget
wid-edit rx xml flymake compile comint ansi-color ring tex-site desktop
frameset drag-stuff browse-kill-ring backtr command-frequency uptimes pp
server easy-mmode assoc advice windmove ac-math-autoloads
auto-complete-clang-autoloads c-eldoc-autoloads
command-frequency-autoloads etags-select-autoloads gap-mode-autoloads
goto-last-change-autoloads hl-sexp-autoloads jabber-autoloads
json-mode-autoloads info easymenu mainline-autoloads
mark-multiple-autoloads php+-mode-autoloads php-eldoc-autoloads
popup-autoloads help-fns cl-macs gv cl cl-loaddefs cl-lib
visible-mark-autoloads yaml-mode-autoloads package time-date tooltip
ediff-hook vc-hooks lisp-float-type mwheel ns-win tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment lisp-mode prog-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 nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process ns
multi-tty emacs)





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

* bug#15211: 24.3.50; Incorrect fontification in c++-mode
  2013-08-29 20:48 bug#15211: 24.3.50; Incorrect fontification in c++-mode Ivan Andrus
@ 2013-08-31 20:56 ` Alan Mackenzie
  2013-09-10 20:04   ` Ivan Andrus
  2013-09-18 20:53 ` Alan Mackenzie
  1 sibling, 1 reply; 6+ messages in thread
From: Alan Mackenzie @ 2013-08-31 20:56 UTC (permalink / raw)
  To: 15211, Ivan Andrus

Hi, Ivan.

> In C and C++ it is legal to place the const to the right of the type as below:

> Json parseJson( string const &json );

> However, this results in "string" not being fontified as a type
> (i.e. with `font-lock-type-face').  It seems to work some times, but the
> minimal example above does not when starting from `emacs -q`.

Yes.  There is special code in `c-forward-type' that causes different
return codes for "string const" and "string".  These two return codes are
specifically differentiated (at the end of `c-forward-decl-or-cast-1')
when deciding whether or not to fontify the identifier.

I've not been able to understand why this code does this - the code has
been in place for well over a decade, and I've been looking at old change
logs.  The following patch disables the distinction and always fontifies
the identifier.  Please try it out and let me know if any undesirable
side effects occur, or if it doesn't quite fix the problem in real code:



diff -r 45df171f9859 cc-engine.el
--- a/cc-engine.el	Sat Aug 31 11:09:30 2013 +0000
+++ b/cc-engine.el	Sat Aug 31 20:32:22 2013 +0000
@@ -7440,7 +7440,8 @@
 	;; interactive refontification.
 	(c-put-c-type-property (point) 'c-decl-arg-start))
 
-      (when (and c-record-type-identifiers at-type (not (eq at-type t)))
+      (when (and c-record-type-identifiers at-type ;; (not (eq at-type t))
+		 )
 	(let ((c-promote-possible-types t))
 	  (save-excursion
 	    (goto-char type-start)


After applying the patch to .../lisp/progmodes/cc-engine.el, just
recompile cc-engine.el with M-x byte-compile-file <CR> cc-engine.el, then
reload cc-engine.elc with M-x load-file <CR> cc-engine.elc.

> Although this is fairly uncommon, there are valid reasons for doing this
> (see http://www.dansaks.com/articles/1999-02%20const%20T%20vs%20T%20const.pdf
> for example), and at work it's ubiquitous.  The lack of fontification is
> annoying since it gives me vi envy. :-)

We can't have that.  ;-)

> Thanks for the overall excellent cc-mode(s)!

And thank you for taking the trouble to report this bug, and even more
for such a high quality bug report.

-Ivan

-- 
Alan Mackenzie (Nuremberg, Germany).





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

* bug#15211: 24.3.50; Incorrect fontification in c++-mode
  2013-08-31 20:56 ` Alan Mackenzie
@ 2013-09-10 20:04   ` Ivan Andrus
  2013-09-18 21:19     ` Alan Mackenzie
  0 siblings, 1 reply; 6+ messages in thread
From: Ivan Andrus @ 2013-09-10 20:04 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: 15211


On Aug 31, 2013, at 2:56 PM, Alan Mackenzie <acm@muc.de> wrote:

> Hi, Ivan.
> 
>> In C and C++ it is legal to place the const to the right of the type as below:
> 
>> Json parseJson( string const &json );
> 
>> However, this results in "string" not being fontified as a type
>> (i.e. with `font-lock-type-face').  It seems to work some times, but the
>> minimal example above does not when starting from `emacs -q`.
> 
> Yes.  There is special code in `c-forward-type' that causes different
> return codes for "string const" and "string".  These two return codes are
> specifically differentiated (at the end of `c-forward-decl-or-cast-1')
> when deciding whether or not to fontify the identifier.
> 
> I've not been able to understand why this code does this - the code has
> been in place for well over a decade, and I've been looking at old change
> logs.  The following patch disables the distinction and always fontifies
> the identifier.  Please try it out and let me know if any undesirable
> side effects occur, or if it doesn't quite fix the problem in real code:

I have been using your diff below for a few days, and I haven't noticed any negative side effects.

There are still two things that don't fontify correctly:


#define DELETE_MEMBER = delete
class Bob
{
    Bob &operator=(Bob const &) = delete; // fontified (with diff applied)
    Bob &operator=(Bob const &) DELETE_MEMBER; // not fontified with or without diff

    Bob( string );    // string is a `font-lock-type-face'
    explicit Bob( string ); // string is `font-lock-variable-name-face'
};


The first bad fontification seems to be caused because it doesn't understand the macro which probably can't be helped.  The second though is a bit more concerning, though it seems to be unrelated to the current bug.  I will probably open another bug for it unless you'd prefer I didn't


> 
> diff -r 45df171f9859 cc-engine.el
> --- a/cc-engine.el	Sat Aug 31 11:09:30 2013 +0000
> +++ b/cc-engine.el	Sat Aug 31 20:32:22 2013 +0000
> @@ -7440,7 +7440,8 @@
> 	;; interactive refontification.
> 	(c-put-c-type-property (point) 'c-decl-arg-start))
> 
> -      (when (and c-record-type-identifiers at-type (not (eq at-type t)))
> +      (when (and c-record-type-identifiers at-type ;; (not (eq at-type t))
> +		 )
> 	(let ((c-promote-possible-types t))
> 	  (save-excursion
> 	    (goto-char type-start)
> 
> 
> After applying the patch to .../lisp/progmodes/cc-engine.el, just
> recompile cc-engine.el with M-x byte-compile-file <CR> cc-engine.el, then
> reload cc-engine.elc with M-x load-file <CR> cc-engine.elc.
> 
>> Although this is fairly uncommon, there are valid reasons for doing this
>> (see http://www.dansaks.com/articles/1999-02%20const%20T%20vs%20T%20const.pdf
>> for example), and at work it's ubiquitous.  The lack of fontification is
>> annoying since it gives me vi envy. :-)
> 
> We can't have that.  ;-)

Don't worry, it doesn't last long.  :-)

>> Thanks for the overall excellent cc-mode(s)!
> 
> And thank you for taking the trouble to report this bug, and even more
> for such a high quality bug report.

Based on how quickly you responded, I wish I had reported it long ago.

Thanks again,
Ivan




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

* bug#15211: 24.3.50; Incorrect fontification in c++-mode
  2013-08-29 20:48 bug#15211: 24.3.50; Incorrect fontification in c++-mode Ivan Andrus
  2013-08-31 20:56 ` Alan Mackenzie
@ 2013-09-18 20:53 ` Alan Mackenzie
  1 sibling, 0 replies; 6+ messages in thread
From: Alan Mackenzie @ 2013-09-18 20:53 UTC (permalink / raw)
  To: 15211-done

Bug fixed by revision #114379.

-- 
Alan Mackenzie (Nuremberg, Germany).





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

* bug#15211: 24.3.50; Incorrect fontification in c++-mode
  2013-09-10 20:04   ` Ivan Andrus
@ 2013-09-18 21:19     ` Alan Mackenzie
  2013-09-19  3:33       ` Ivan Andrus
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Mackenzie @ 2013-09-18 21:19 UTC (permalink / raw)
  To: Ivan Andrus; +Cc: 15211

Hi, Ivan.

On Tue, Sep 10, 2013 at 02:04:31PM -0600, Ivan Andrus wrote:

> On Aug 31, 2013, at 2:56 PM, Alan Mackenzie <acm@muc.de> wrote:

> > The following patch disables the distinction and always fontifies the
> > identifier.  Please try it out and let me know if any undesirable
> > side effects occur, or if it doesn't quite fix the problem in real
> > code:

> I have been using your diff below for a few days, and I haven't noticed
> any negative side effects.

Thanks.  I've committed the patch to the bazaar repository and marked the
bug as closed.

> There are still two things that don't fontify correctly:


> #define DELETE_MEMBER = delete
> class Bob
> {
>     Bob &operator=(Bob const &) = delete; // fontified (with diff applied)
>     Bob &operator=(Bob const &) DELETE_MEMBER; // not fontified with or without diff

>     Bob( string );    // string is a `font-lock-type-face'
>     explicit Bob( string ); // string is `font-lock-variable-name-face'
> };


> The first bad fontification seems to be caused because it doesn't
> understand the macro which probably can't be helped.

I think so.  Though I don't understand what the "= delete;" bit means
(I'm not a C++ hacker).

> The second though is a bit more concerning, though it seems to be
> unrelated to the current bug.  I will probably open another bug for it
> unless you'd prefer I didn't

I'd rather you did open a separate bug, please.  As a matter of interest,
in "Bob( string );" (without the "explicit"), I don't get either
identifier fontified.

> Thanks again,
> Ivan

-- 
Alan Mackenzie (Nuremberg, Germany).





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

* bug#15211: 24.3.50; Incorrect fontification in c++-mode
  2013-09-18 21:19     ` Alan Mackenzie
@ 2013-09-19  3:33       ` Ivan Andrus
  0 siblings, 0 replies; 6+ messages in thread
From: Ivan Andrus @ 2013-09-19  3:33 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: 15211

On Sep 18, 2013, at 3:19 PM, Alan Mackenzie <acm@muc.de> wrote:

> Hi, Ivan.
> 
> On Tue, Sep 10, 2013 at 02:04:31PM -0600, Ivan Andrus wrote:
> 
>> On Aug 31, 2013, at 2:56 PM, Alan Mackenzie <acm@muc.de> wrote:
> 
>>> The following patch disables the distinction and always fontifies the
>>> identifier.  Please try it out and let me know if any undesirable
>>> side effects occur, or if it doesn't quite fix the problem in real
>>> code:
> 
>> I have been using your diff below for a few days, and I haven't noticed
>> any negative side effects.
> 
> Thanks.  I've committed the patch to the bazaar repository and marked the
> bug as closed.
> 
>> There are still two things that don't fontify correctly:
> 
> 
>> #define DELETE_MEMBER = delete
>> class Bob
>> {
>>    Bob &operator=(Bob const &) = delete; // fontified (with diff applied)
>>    Bob &operator=(Bob const &) DELETE_MEMBER; // not fontified with or without diff
> 
>>    Bob( string );    // string is a `font-lock-type-face'
>>    explicit Bob( string ); // string is `font-lock-variable-name-face'
>> };
> 
> 
>> The first bad fontification seems to be caused because it doesn't
>> understand the macro which probably can't be helped.
> 
> I think so.  Though I don't understand what the "= delete;" bit means
> (I'm not a C++ hacker).

It means don't automatically generate the function (in this case the 
assignment operator).  Normally the compiler will automatically create
certain functions like destructors.

>> The second though is a bit more concerning, though it seems to be
>> unrelated to the current bug.  I will probably open another bug for it
>> unless you'd prefer I didn't
> 
> I'd rather you did open a separate bug, please.  As a matter of interest,
> in "Bob( string );" (without the "explicit"), I don't get either
> identifier fontified. 

It's now bug 15415.

>> Thanks again,
>> Ivan
> 
> -- 
> Alan Mackenzie (Nuremberg, Germany).






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

end of thread, other threads:[~2013-09-19  3:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-29 20:48 bug#15211: 24.3.50; Incorrect fontification in c++-mode Ivan Andrus
2013-08-31 20:56 ` Alan Mackenzie
2013-09-10 20:04   ` Ivan Andrus
2013-09-18 21:19     ` Alan Mackenzie
2013-09-19  3:33       ` Ivan Andrus
2013-09-18 20:53 ` Alan Mackenzie

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