GNU bug report logs - #9448
24.0.50; Comments in Awk scripts not fontified with comment face

Previous Next

Packages: emacs, cc-mode;

Reported by: Eli Zaretskii <eliz <at> gnu.org>

Date: Tue, 6 Sep 2011 04:32:02 UTC

Severity: normal

Found in version 24.0.50

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9448 in the body.
You can then email your comments to 9448 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9448; Package emacs. (Tue, 06 Sep 2011 04:32:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Eli Zaretskii <eliz <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 06 Sep 2011 04:32:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.50; Comments in Awk scripts not fontified with comment face
Date: Tue, 06 Sep 2011 00:27:12 -0400
  emacs -Q
  C-x C-f foo.awk RET

Type "# something" (without quotes).  The comment is not highlighted
in the font-lock-comment face, as expected.  comment-start and
comment-start-skip seem to have reasonable values.


In GNU Emacs 24.0.50.8 (x86_64-unknown-linux-gnu, GTK+ Version 2.20.1)
 of 2011-09-05 on fencepost
configured using `configure  '--enable-asserts' '--enable-checking' '--with-gif=no' '--with-tiff=no''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default enable-multibyte-characters: t

Major mode: RMAIL

Minor modes in effect:
  shell-dirtrack-mode: t
  display-time-mode: t
  show-paren-mode: t
  savehist-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
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t

Recent input:
o n SPC a s SPC p a r t SPC o f SPC t h e SPC s t a 
n d a l o n e SPC i n s t a l l e r SPC i s SPC t h 
e SPC o n l y SPC p r a c t i c a l SPC w a y . ESC 
O B RET ESC < ESC > ESC O D ESC O D SPC t h a t SPC 
d o e s n ' t SPC r e q u i r e SPC P y t h i o n ESC 
O D ESC O D DEL ESC O B ESC O D ESC O D ESC b a SPC 
ESC f SPC i n s t a l l a t i o n ESC q ESC O B C-c 
C-c ESC ! ESC O A RET ESC x ESC O A RET ESC O A RET 
C-s 0 8 : 1 8 : 4 1 ESC O B ESC [ 6 ~ ESC [ 6 ~ ESC 
O B ESC O B ESC O B ESC O B C-x C-x C-w C-x C-s C-x 
k RET C-u g ESC O A RET d d d C-x C-s ESC O B ESC O 
A C-u g ESC O A DEL e w RET d d n d d d d d d d d d 
d d d d d d d d d d d d C-x C-z C-x C-f f o o . a w 
k RET # SPC f o o RET ESC ~ C-x b RET C-x C-z ESC x 
r e p o r t - e m a c s - b u g RET

Recent messages:
Counting new messages...done (24)
Saving file /home/e/eliz/INBOX...
Wrote /home/e/eliz/INBOX [2 times]
Computing summary lines...done
24 new messages read
Showing message 673
Showing message 673...done
No following nondeleted message
(New file)
Modification-flag cleared

Load-path shadows:
None found.

Features:
(shadow emacsbug cc-awk shell pcomplete comint ring newcomment
flyspell ispell multi-isearch vc-bzr cc-mode cc-fonts cc-guess
cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs qp
rmailsum rmailmm message sendmail regexp-opt format-spec rfc822 mml
easymenu mml-sec mm-decode mm-bodies mm-encode mailabbrev gmm-utils
mailheader mail-parse rfc2231 rmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils time paren cus-start cus-load time-date savehist
saveplace tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win
x-dnd tool-bar dnd fontset image fringe 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
dynamic-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty emacs)




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#9448; Package emacs,cc-mode. (Wed, 07 Sep 2011 07:56:01 GMT) Full text and rfc822 format available.

Message #8 received at 9448 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 9448 <at> debbugs.gnu.org
Subject: Re: bug#9448: 24.0.50;
	Comments in Awk scripts not fontified with comment face
Date: Wed, 07 Sep 2011 03:51:32 -0400
If you delete the compiled version of cc-fonts, it works...




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#9448; Package emacs,cc-mode. (Wed, 07 Sep 2011 16:36:01 GMT) Full text and rfc822 format available.

Message #11 received at 9448 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 9448 <at> debbugs.gnu.org
Subject: Re: bug#9448: 24.0.50;
	Comments in Awk scripts not fontified with comment face
Date: Wed, 07 Sep 2011 19:30:19 +0300
> From: Glenn Morris <rgm <at> gnu.org>
> Cc: 9448 <at> debbugs.gnu.org
> Date: Wed, 07 Sep 2011 03:51:32 -0400
> 
> 
> If you delete the compiled version of cc-fonts, it works...

You mean, delete it and never compile it again, yes?




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#9448; Package emacs,cc-mode. (Wed, 07 Sep 2011 17:10:02 GMT) Full text and rfc822 format available.

Message #14 received at 9448 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: 9448 <at> debbugs.gnu.org
Subject: asdf
Date: Wed, 7 Sep 2011 17:01:47 +0000
Hi, Eli and Glenn.

>  emacs -Q
>  C-x C-f foo.awk RET

> Type "# something" (without quotes).  The comment is not highlighted
> in the font-lock-comment face, as expected.  comment-start and
> comment-start-skip seem to have reasonable values.


A bit of binary chopping shows that the bug first became visible after
this change:


  revno: 104401
  committer: Chong Yidong <cyd <at> stupidchicken.com>
  branch nick: trunk
  timestamp: Sat 2011-05-28 13:16:54 -0400
  message:
    Make CC modes inherit from prog-mode.

    * lisp/progmodes/cc-mode.el (c-mode, c++-mode, objc-mode, java-mode)
    (idl-mode, pike-mode, awk-mode): Inherit from prog-mode.


I cannot see anything in the change with looks remotely suspicious,
however.  Except, of course, that AWK Mode is now constructed by a macro
of some complexity, doubly invoked.

Deleting cc-fonts.elc (thus allowing cc-fonts.el to be loaded) gets
fontification of AWK comments working for me, too.

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#9448; Package emacs,cc-mode. (Wed, 07 Sep 2011 18:23:01 GMT) Full text and rfc822 format available.

Message #17 received at 9448 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: 9448 <at> debbugs.gnu.org
Subject: Re: 24.0.50; Comments in Awk scripts not fontified with comment face
Date: Wed, 7 Sep 2011 18:14:29 +0000
Hi, all.

On Wed, Sep 07, 2011 at 05:01:47PM +0000, Alan Mackenzie wrote:

> >  emacs -Q
> >  C-x C-f foo.awk RET

> > Type "# something" (without quotes).  The comment is not highlighted
> > in the font-lock-comment face, as expected.  comment-start and
> > comment-start-skip seem to have reasonable values.


> A bit of binary chopping shows that the bug first became visible after
> this change:


>   revno: 104401
>   committer: Chong Yidong <cyd <at> stupidchicken.com>
>   branch nick: trunk
>   timestamp: Sat 2011-05-28 13:16:54 -0400
>   message:
>     Make CC modes inherit from prog-mode.

>     * lisp/progmodes/cc-mode.el (c-mode, c++-mode, objc-mode, java-mode)
>     (idl-mode, pike-mode, awk-mode): Inherit from prog-mode.


> I cannot see anything in the change with looks remotely suspicious,
> however.  Except, of course, that AWK Mode is now constructed by a macro
> of some complexity, doubly invoked.

I think I see the problem, it's with the macro `define-derived-mode'.
This creates an empty syntax table with (defvar awk-mode-syntax-table),
and does this before cc-awk.elc has been loaded.  This thus stuffs the
proper definition of awk-mode-syntax-table.

Because of this, ?# doesn't have the open-comment syntax flag, thus
comments can't get fontified.

If I'm right about this, a solution would be to insert

   (makunbound 'awk-mode-syntax-table)
   
at the top of the mode initialisation.  Why on earth does
`define-derived-mode' have the temerity to create an empty, thus useless,
syntax table?  Maybe this should be taken out of the macro.

> Deleting cc-fonts.elc (thus allowing cc-fonts.el to be loaded) gets
> fontification of AWK comments working for me, too.

I still don't have a clue why this is happening.

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#9448; Package emacs,cc-mode. (Wed, 07 Sep 2011 19:22:01 GMT) Full text and rfc822 format available.

Message #20 received at 9448 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 9448 <at> debbugs.gnu.org
Subject: Re: bug#9448: 24.0.50;
	Comments in Awk scripts not fontified with comment face
Date: Wed, 07 Sep 2011 15:17:36 -0400
Alan Mackenzie wrote:

> I think I see the problem, it's with the macro `define-derived-mode'.
> This creates an empty syntax table with (defvar awk-mode-syntax-table),
> and does this before cc-awk.elc has been loaded.  This thus stuffs the
> proper definition of awk-mode-syntax-table.

That's interesting. I imagine in most cases, all the definitions are in
the same file, eg:

(defvar foo-mode-map ... )
(defvar foo-mode-syntax-table ... )
(define-derived-mode foo-mode ... )

cc-awk is unusual in that the actual mode is defined in cc-mode.el and
requires cc-awk.el as part of its execution.

Another option is to move awk-mode-syntax-table from cc-awk.el to
cc-mode.el (I see the mode-map and abbrev-table are already there).
Unbinding it might erase any user customization.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#9448; Package emacs,cc-mode. (Thu, 08 Sep 2011 02:17:01 GMT) Full text and rfc822 format available.

Message #23 received at 9448 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 9448 <at> debbugs.gnu.org
Subject: Re: bug#9448: 24.0.50;
	Comments in Awk scripts not fontified with comment face
Date: Wed, 07 Sep 2011 22:12:40 -0400
> If I'm right about this, a solution would be to insert
>    (makunbound 'awk-mode-syntax-table)

I wouldn't consider this as a solution.  I see a few solutions, tho:
- move the defvar from cc-awk to cc-mode.
- move the define-derived-mode to cc-awk (sounds natural, from my
  "I haven't looked at the code" point of view).
- add a ":syntax-table awk-mode-syntax-table" argument to define-derived-mode.

> at the top of the mode initialisation.  Why on earth does
> `define-derived-mode' have the temerity to create an empty, thus useless,
> syntax table?

It's actually not empty: it inherits from the parent.  This is taken
directly from the original define-derived-mode, which was oddly meant
for end-users.
It also has the advantage to ensure that every major-mode defined with
define-derived-mode will have a foo-mode-syntax-table.

> Maybe this should be taken out of the macro.

Maybe so, yes.  I'm not completely sure.  In any case it's too late to
do that for Emacs-24.  But we could try it out in Emacs-25.


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#9448; Package emacs,cc-mode. (Thu, 08 Sep 2011 06:21:02 GMT) Full text and rfc822 format available.

Message #26 received at 9448 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Alan Mackenzie <acm <at> muc.de>, 9448 <at> debbugs.gnu.org
Subject: Re: bug#9448: 24.0.50;
	Comments in Awk scripts not fontified with comment face
Date: Thu, 08 Sep 2011 02:16:09 -0400
Stefan Monnier wrote:

> - add a ":syntax-table awk-mode-syntax-table" argument to define-derived-mode.

This doesn't work by itself. When calling `awk-mode', cc-awk.el is not
loaded early enough.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#9448; Package emacs,cc-mode. (Thu, 08 Sep 2011 08:41:02 GMT) Full text and rfc822 format available.

Message #29 received at 9448 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 9448 <at> debbugs.gnu.org
Subject: Re: bug#9448: 24.0.50; Comments in Awk scripts not fontified with
	comment face
Date: Thu, 8 Sep 2011 08:33:11 +0000
Hi, Stefan

On Wed, Sep 07, 2011 at 10:12:40PM -0400, Stefan Monnier wrote:
> > If I'm right about this, a solution would be to insert
> >    (makunbound 'awk-mode-syntax-table)

> I wouldn't consider this as a solution.

It doesn't work anyway.  ;-)

> I see a few solutions, tho:
> - move the defvar from cc-awk to cc-mode.

Undesirable.

> - move the define-derived-mode to cc-awk (sounds natural, from my
>   "I haven't looked at the code" point of view).

That's beginning to sound serious.  CC Mode is structured so that the
interface with the "OS" bit of the host Emacs is in cc-mode.el.

> - add a ":syntax-table awk-mode-syntax-table" argument to define-derived-mode.

I've tried :syntax-table nil, and this doesn't generate
awk-mode-syntax-table.  It appears to work.

> > at the top of the mode initialisation.  Why on earth does
> > `define-derived-mode' have the temerity to create an empty, thus useless,
> > syntax table?

> It's actually not empty: it inherits from the parent.  This is taken
> directly from the original define-derived-mode, which was oddly meant
> for end-users.
> It also has the advantage to ensure that every major-mode defined with
> define-derived-mode will have a foo-mode-syntax-table.

> > Maybe this should be taken out of the macro.

> Maybe so, yes.  I'm not completely sure.  In any case it's too late to
> do that for Emacs-24.  But we could try it out in Emacs-25.

OK.

One other thing is bothering me quite a bit.  Just before all this, at
L1530 in cc-mode.el is the line

    (defvar awk-mode-syntax-table)

.  This ought to prevent my solution above from working, but it doesn't.
Glenn, I think you put this line in.  Why?  Would it be OK to take it out
again?

BTW, I've found out why deleting cc-fonts.elc does what it does.  There
is a "(cc-require-when-compile 'cc-awk)" in cc-fonts.el.  When this file
isn't byte compiled, that form loads cc-awk.elc, and this happens before
the bulk of cc-mode.elc is loaded.  That form should probably be removed,
since it no longer serves a purpose.

Glenn, what on earth brought you to try deleting cc-fonts.elc?  It seems
a stroke of genius, but how did you come to consider it?  :-)

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#9448; Package emacs,cc-mode. (Thu, 08 Sep 2011 18:41:01 GMT) Full text and rfc822 format available.

Message #32 received at 9448 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 9448 <at> debbugs.gnu.org
Subject: Re: bug#9448: 24.0.50;
	Comments in Awk scripts not fontified with comment face
Date: Thu, 08 Sep 2011 14:36:24 -0400
Alan Mackenzie wrote:

>     (defvar awk-mode-syntax-table)
>
> . This ought to prevent my solution above from working, but it
> doesn't. Glenn, I think you put this line in. Why? Would it be OK to
> take it out again?

A defvar with no initvalue just suppresses a byte-compiler warning about
said variable being undefined. It doesn't actually define the variable,
so I think that line should stay there, to stop the compiler complaining
about an undefined variable in

  (set-syntax-table awk-mode-syntax-table)

(So by the way I think this means cc-bytecomp-defvar is no longer
needed. Also cc-bytecomp-defun can be replaced by declare-function.)

> Glenn, what on earth brought you to try deleting cc-fonts.elc?  It seems
> a stroke of genius, but how did you come to consider it?  :-)

I saw from the ChangeLog that cc-fonts was the most recent part of
cc-mode to be changed, so I tried reverting that commit. To make it take
effect, I deleted the old cc-fonts.elc rather than recompiling it.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#9448; Package emacs,cc-mode. (Thu, 08 Sep 2011 21:22:02 GMT) Full text and rfc822 format available.

Message #35 received at 9448 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 9448 <at> debbugs.gnu.org
Subject: Re: bug#9448: 24.0.50; Comments in Awk scripts not fontified with
	comment face
Date: Thu, 8 Sep 2011 21:13:48 +0000
On Thu, Sep 08, 2011 at 02:36:24PM -0400, Glenn Morris wrote:
> Alan Mackenzie wrote:

> >     (defvar awk-mode-syntax-table)

> > . This ought to prevent my solution above from working, but it
> > doesn't. Glenn, I think you put this line in. Why? Would it be OK to
> > take it out again?

> A defvar with no initvalue just suppresses a byte-compiler warning about
> said variable being undefined. It doesn't actually define the variable,
> ...

Well, you learn something new every day.  :-)  I'd thought that (defvar
foo nil) and (defvar foo) were the same.  They're not.

> so I think that line should stay there, to stop the compiler complaining
> about an undefined variable in

>   (set-syntax-table awk-mode-syntax-table)

OK.

> (So by the way I think this means cc-bytecomp-defvar is no longer
> needed. Also cc-bytecomp-defun can be replaced by declare-function.)

There's the rub.  The more such "tidying up" changes are made in
savannah, the more difficult it becomes for me to synch changes with the
upstream CC Mode.  There're already > 80 such differences in cc-mode.el
alone.

> > Glenn, what on earth brought you to try deleting cc-fonts.elc?  It seems
> > a stroke of genius, but how did you come to consider it?  :-)

> I saw from the ChangeLog that cc-fonts was the most recent part of
> cc-mode to be changed, so I tried reverting that commit. To make it take
> effect, I deleted the old cc-fonts.elc rather than recompiling it.

And the irony is, AWK code doesn't use cc-fonts.elc for its
fontification; it uses a simple regexp based model.  ;-)

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#9448; Package emacs,cc-mode. (Thu, 08 Sep 2011 21:55:01 GMT) Full text and rfc822 format available.

Message #38 received at 9448 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 9448 <at> debbugs.gnu.org
Subject: Re: bug#9448: 24.0.50;
	Comments in Awk scripts not fontified with comment face
Date: Thu, 08 Sep 2011 17:50:36 -0400
Alan Mackenzie wrote:

> There's the rub.  The more such "tidying up" changes are made in
> savannah, the more difficult it becomes for me to synch changes with the
> upstream CC Mode.  There're already > 80 such differences in cc-mode.el
> alone.

(defvar foo)

works to silence the compiler since at least Emacs 21.4 (I think).

declare-function works since Emacs 23.1, and exists as a no-op in Emacs
22.2 and 22.3.

I hope that one day cc-bytecomp can just be removed. The part that deals
with "an older CC Mode with outdated macros [being] loaded during
compilation" is clever, but IMO just adds a bunch of complexity to solve
a problem that doesn't need solving. Files should be compiled in batch
mode in a separate Emacs instance.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#9448; Package emacs,cc-mode. (Thu, 08 Sep 2011 22:22:02 GMT) Full text and rfc822 format available.

Message #41 received at 9448 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 9448 <at> debbugs.gnu.org
Subject: Re: bug#9448: 24.0.50; Comments in Awk scripts not fontified with
	comment face
Date: Thu, 8 Sep 2011 22:13:39 +0000
Hi, Glenn.

On Thu, Sep 08, 2011 at 05:50:36PM -0400, Glenn Morris wrote:
> Alan Mackenzie wrote:

> > There's the rub.  The more such "tidying up" changes are made in
> > savannah, the more difficult it becomes for me to synch changes with the
> > upstream CC Mode.  There're already > 80 such differences in cc-mode.el
> > alone.

> (defvar foo)

> works to silence the compiler since at least Emacs 21.4 (I think).

There're quite a few other such constructs.  Does it work under XEmacs?
If so which versions.  They're all things which are easy to check, but
cumulatively it's a massive time sink.

> declare-function works since Emacs 23.1, and exists as a no-op in Emacs
> 22.2 and 22.3.

Again, what about XEmacs?

> I hope that one day cc-bytecomp can just be removed. The part that deals
> with "an older CC Mode with outdated macros [being] loaded during
> compilation" is clever, but IMO just adds a bunch of complexity to solve
> a problem that doesn't need solving. Files should be compiled in batch
> mode in a separate Emacs instance.

I'd agree with you about its eventual removal.  Clearly there was a big
problem to solve - something like cc-bytecomp.el doesn't get knocked
together in a couple of hours.  I suspect Martin Stjernholm was having
big problems with his various versions during development, and that
cc-bytecomp is more for me and colleagues rather than ordinary users.

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#9448; Package emacs,cc-mode. (Fri, 09 Sep 2011 02:32:01 GMT) Full text and rfc822 format available.

Message #44 received at 9448 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Alan Mackenzie <acm <at> muc.de>
Cc: Glenn Morris <rgm <at> gnu.org>, 9448 <at> debbugs.gnu.org
Subject: Re: bug#9448: 24.0.50;
	Comments in Awk scripts not fontified with comment face
Date: Thu, 08 Sep 2011 22:27:04 -0400
> ... XEmacs ... it's a massive time sink.

I tend to agree ;-)


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#9448; Package emacs,cc-mode. (Fri, 09 Sep 2011 03:49:02 GMT) Full text and rfc822 format available.

Message #47 received at 9448 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 9448 <at> debbugs.gnu.org
Subject: Re: bug#9448: 24.0.50;
	Comments in Awk scripts not fontified with comment face
Date: Thu, 08 Sep 2011 23:44:37 -0400
Alan Mackenzie wrote:

> Again, what about XEmacs?

It's your call as to how relevant you think other varieties of Emacs are
to you and to others, and how much effort you think it's worth investing
in supporting them.

If it takes a lot of time to ensure that the latest cc-mode runs on a
bunch of platforms, then personally I think that's time that could be
better spent, in making it work better on fewer.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#9448; Package emacs,cc-mode. (Fri, 09 Sep 2011 07:06:01 GMT) Full text and rfc822 format available.

Message #50 received at 9448 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: rgm <at> gnu.org, 9448 <at> debbugs.gnu.org
Subject: Re: bug#9448: 24.0.50;
	Comments in Awk scripts not fontified with comment face
Date: Fri, 09 Sep 2011 10:01:10 +0300
> Date: Thu, 8 Sep 2011 21:13:48 +0000
> From: Alan Mackenzie <acm <at> muc.de>
> Cc: 9448 <at> debbugs.gnu.org
> 
> There's the rub.  The more such "tidying up" changes are made in
> savannah, the more difficult it becomes for me to synch changes with the
> upstream CC Mode.  There're already > 80 such differences in cc-mode.el
> alone.

How about switching CC Mode repo from CVS to Bazar?  Then merges would
be seamless.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#9448; Package emacs,cc-mode. (Fri, 09 Sep 2011 07:10:02 GMT) Full text and rfc822 format available.

Message #53 received at 9448 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: acm <at> muc.de, 9448 <at> debbugs.gnu.org
Subject: Re: bug#9448: 24.0.50;
	Comments in Awk scripts not fontified with comment face
Date: Fri, 09 Sep 2011 10:04:47 +0300
> From: Glenn Morris <rgm <at> gnu.org>
> Date: Thu, 08 Sep 2011 17:50:36 -0400
> Cc: 9448 <at> debbugs.gnu.org
> 
> Files should be compiled in batch mode in a separate Emacs instance.

Are you saying that emacs-lisp-byte-compile-and-load's interactive use
should be discouraged?  I use it quite frequently to test changes in
the same Emacs session where I make those changes.  If we think it's
not a good idea, then we should deprecate the command and remove the
corresponding menu item.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#9448; Package emacs,cc-mode. (Fri, 09 Sep 2011 07:17:02 GMT) Full text and rfc822 format available.

Message #56 received at 9448 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: acm <at> muc.de, 9448 <at> debbugs.gnu.org
Subject: Re: bug#9448: 24.0.50;
	Comments in Awk scripts not fontified with comment face
Date: Fri, 09 Sep 2011 03:12:11 -0400
Eli Zaretskii wrote:

> Are you saying that emacs-lisp-byte-compile-and-load's interactive use
> should be discouraged?  I use it quite frequently to test changes in
> the same Emacs session where I make those changes.

No; I use it like that too. All I'm saying is, when you download
someone's foo-mode to install it on your system, foo-mode's installation
process should compile it using batch mode.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#9448; Package emacs,cc-mode. (Fri, 09 Sep 2011 07:24:02 GMT) Full text and rfc822 format available.

Message #59 received at 9448 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: acm <at> muc.de, 9448 <at> debbugs.gnu.org
Subject: Re: bug#9448: 24.0.50;
	Comments in Awk scripts not fontified with comment face
Date: Fri, 09 Sep 2011 03:19:48 -0400
Glenn Morris wrote:

> Eli Zaretskii wrote:
>
>> Are you saying that emacs-lisp-byte-compile-and-load's interactive use
>> should be discouraged?  I use it quite frequently to test changes in
>> the same Emacs session where I make those changes.
>
> No; I use it like that too. All I'm saying is, when you download
> someone's foo-mode to install it on your system, foo-mode's installation
> process should compile it using batch mode.

In fact, I'm not even saying that, because for a single, simple foo.el
compiling it in a running Emacs is probably fine. I'm just saying that
if I were compiling something as complex as cc-mode, I'd definitely do
it in batch-mode, and would not try to support the case where an older
cc-mode is already loaded in the compiling Emacs.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#9448; Package emacs,cc-mode. (Fri, 09 Sep 2011 09:47:02 GMT) Full text and rfc822 format available.

Message #62 received at 9448 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: rgm <at> gnu.org, 9448 <at> debbugs.gnu.org
Subject: Re: bug#9448: 24.0.50;	Comments in Awk scripts not fontified with
	comment face
Date: Fri, 9 Sep 2011 09:38:46 +0000
Morning, Eli.

On Fri, Sep 09, 2011 at 10:01:10AM +0300, Eli Zaretskii wrote:
> > Date: Thu, 8 Sep 2011 21:13:48 +0000
> > From: Alan Mackenzie <acm <at> muc.de>
> > Cc: 9448 <at> debbugs.gnu.org

> > There's the rub.  The more such "tidying up" changes are made in
> > savannah, the more difficult it becomes for me to synch changes with the
> > upstream CC Mode.  There're already > 80 such differences in cc-mode.el
> > alone.

> How about switching CC Mode repo from CVS to Bazar?  Then merges would
> be seamless.

Some time soon I'll probably be forced to change, since SourceForge won't
be supporting CVS for ever.

The time taken is checking each individual change.  Some of them will
break support for older Emacsen.  Ediff works well.

-- 
Alan Mackenzie (Nuremberg, Germany).




Reply sent to Alan Mackenzie <acm <at> muc.de>:
You have taken responsibility. (Fri, 09 Sep 2011 10:05:01 GMT) Full text and rfc822 format available.

Notification sent to Eli Zaretskii <eliz <at> gnu.org>:
bug acknowledged by developer. (Fri, 09 Sep 2011 10:05:02 GMT) Full text and rfc822 format available.

Message #67 received at 9448-done <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: 9448-done <at> debbugs.gnu.org
Subject: Bug fixed.
Date: Fri, 9 Sep 2011 09:56:50 +0000
Bug fixed.

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#9448; Package emacs,cc-mode. (Fri, 09 Sep 2011 10:10:02 GMT) Full text and rfc822 format available.

Message #70 received at 9448 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>, Eli Zaretskii <eliz <at> gnu.org>,
	Glenn Morris <rgm <at> gnu.org>
Cc: 9448 <at> debbugs.gnu.org
Subject: Re: bug#9448: 24.0.50; Comments in Awk scripts not fontified with
	comment face
Date: Fri, 9 Sep 2011 10:02:09 +0000
Hi, everybody.

On Thu, Sep 08, 2011 at 08:33:11AM +0000, Alan Mackenzie wrote:

> I've tried :syntax-table nil [in the define-derived-mode macro], and
> this doesn't generate awk-mode-syntax-table.  It appears to work.

I've just committed this fix and marked the bug as fixed.

-- 
Alan Mackenzie (Nuremberg, Germany).




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 07 Oct 2011 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 338 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.