unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* CC Mode 5.30.1 (Message); new cc-awk mode indentation wrong after ++
@ 2003-07-04  1:28 Miles Bader
  2003-07-06 15:02 ` Alan Mackenzie
  0 siblings, 1 reply; 10+ messages in thread
From: Miles Bader @ 2003-07-04  1:28 UTC (permalink / raw
  Cc: emacs-devel


The new cc-awk mode seems to indent incorrectly on lines following a
suffix `++' operator, e.g., the following is indented by the new
awk-mode:

   {
     h++
       print "foo"
       print "bar"
   }

[This mode is generally brilliant, by the way -- now I can finally
trust emacs to indent my awk programs, which simply wasn't possible
before!]

Thanks,

-Miles


Emacs  : GNU Emacs 21.3.50.270 (i686-pc-linux-gnu)
 of 2003-07-04 on mcspd15
Package: CC Mode 5.30.1 (Message)
Buffer Style: nil
c-emacs-features: (posix-char-classes pps-extended-state col-0-paren gen-string-delim gen-comment-delim syntax-properties 1-bit)

current state:
==============
(setq
 c-basic-offset 'set-from-style
 c-comment-only-line-offset '(0 . 0)
 c-indent-comment-alist 'set-from-style
 c-indent-comments-syntactically-p 'set-from-style
 c-block-comment-prefix ""
 c-comment-prefix-regexp 'set-from-style
 c-doc-comment-style 'set-from-style
 c-cleanup-list 'set-from-style
 c-hanging-braces-alist 'set-from-style
 c-hanging-colons-alist 'set-from-style
 c-hanging-semi&comma-criteria 'set-from-style
 c-backslash-column 78
 c-backslash-max-column 78
 c-special-indent-hook nil
 c-label-minimum-indentation 'set-from-style
 c-offsets-alist nil
 c-buffer-is-cc-mode nil
 c-tab-always-indent nil
 c-syntactic-indentation t
 c-syntactic-indentation-in-macros t
 c-ignore-auto-fill '(string cpp code)
 c-auto-align-backslashes t
 c-backspace-function 'backward-delete-char-untabify
 c-delete-function 'delete-char
 c-electric-pound-behavior nil
 c-default-style '((java-mode . "java") (other . "gnu"))
 c-enable-xemacs-performance-kludge-p nil
 c-old-style-variable-behavior nil
 defun-prompt-regexp nil
 tab-width 8
 comment-column 32
 parse-sexp-ignore-comments t
 parse-sexp-lookup-properties t
 auto-fill-function 'do-auto-fill
 comment-multi-line nil
 comment-start-skip nil
 fill-prefix nil
 fill-column 72
 paragraph-start "$\\|[ 	]*$\\|-- $\\|---+$\\|^\f$\\|.*wrote:$\\|[ 	]*\\(\\(> \\|\\w+>\\|[|:>]\\)[ 	]*\\)+$\\|^-- $"
 adaptive-fill-mode t
 adaptive-fill-regexp "[ 	]*\\(\\(> \\|\\w+>\\|[|:>]\\)[ 	]*\\)+\\|[ 	]*\\([-!|#%;>*]+[ 	]*\\|(?[0-9]+[.)][ 	]*\\)*"
 )
-- 
"1971 pickup truck; will trade for guns"

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

* Re: CC Mode 5.30.1 (Message); new cc-awk mode indentation wrong after ++
  2003-07-04  1:28 CC Mode 5.30.1 (Message); new cc-awk mode indentation wrong after ++ Miles Bader
@ 2003-07-06 15:02 ` Alan Mackenzie
  2003-07-07  3:39   ` Richard Stallman
  0 siblings, 1 reply; 10+ messages in thread
From: Alan Mackenzie @ 2003-07-06 15:02 UTC (permalink / raw
  Cc: emacs-devel

Hi, Miles!

On 4 Jul 2003, Miles Bader wrote:

>The new cc-awk mode seems to indent incorrectly on lines following a
>suffix `++' operator, e.g., the following is indented by the new
>awk-mode:

>   {
>     h++
>       print "foo"
>       print "bar"
>   }

The fix will appear in the upcoming version 5.30.3.  Alternatively, apply
the following patch to the cc-engine.el in 5.30.1:

*************************************************************************
512,515c512,514
< 	       (c-backward-syntactic-ws) ; might go back an awk-mode virtual semicolon, here.
<                                         ; How about using c-awk-NL-prop for AWK Mode, here.
<                                         ; Something like c-awk-backward-syntactic-ws.
<                                         ; 2002/6/22.  Doesn't matter!  Leave it as it is.
---
>                (if (c-mode-is-new-awk-p)
>                    (c-awk-backward-syntactic-ws)
>                  (c-backward-syntactic-ws))
823c822,824
< 	       (c-backward-syntactic-ws)
---
> 	       (if (c-mode-is-new-awk-p)
>                    (c-awk-backward-syntactic-ws)
>                  (c-backward-syntactic-ws))
*************************************************************************

Many thanks for the bug report.

>-Miles

-- 
Alan Mackenzie (Munich, Germany)

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

* Re: CC Mode 5.30.1 (Message); new cc-awk mode indentation wrong after ++
  2003-07-06 15:02 ` Alan Mackenzie
@ 2003-07-07  3:39   ` Richard Stallman
  2003-07-07  7:44     ` Alan Mackenzie
  0 siblings, 1 reply; 10+ messages in thread
From: Richard Stallman @ 2003-07-07  3:39 UTC (permalink / raw
  Cc: miles, emacs-devel, bug-cc-mode

    The fix will appear in the upcoming version 5.30.3.  Alternatively, apply
    the following patch to the cc-engine.el in 5.30.1:

Could someone install the right patch in the Emacs CVS sources,
or else send the patch in -c format so people can install it?


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01


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

* Re: CC Mode 5.30.1 (Message); new cc-awk mode indentation wrong after ++
  2003-07-07  3:39   ` Richard Stallman
@ 2003-07-07  7:44     ` Alan Mackenzie
  2003-07-08 14:28       ` Richard Stallman
  0 siblings, 1 reply; 10+ messages in thread
From: Alan Mackenzie @ 2003-07-07  7:44 UTC (permalink / raw
  Cc: miles



On Sun, 6 Jul 2003, Richard Stallman wrote:

>    The fix will appear in the upcoming version 5.30.3.  Alternatively,
>    apply the following patch to the cc-engine.el in 5.30.1:

>Could someone install the right patch in the Emacs CVS sources, or else
>send the patch in -c format so people can install it?

HELP!!!  Can I get my breath back, please?

I sent this patch off as a quick fix for Miles, who had reported the bug.
(But yes, I should have used the -c format, for which see below.)  But
surely what should be installed in the Emacs CVS are the controlled
mini-releases, 5.30.n, rather than wild one-off patches.


Here's the patch again as a diff -c:

*************************************************************************
*** cc-engine.el	Sun Jul  6 11:30:49 2003
--- cc-engine.fixed.el	Sun Jul  6 11:59:33 2003
***************
*** 509,518 ****
        ;; that we've moved.
        (while (progn
  	       (setq pos (point))
! 	       (c-backward-syntactic-ws) ; might go back an awk-mode virtual semicolon, here.
!                                         ; How about using c-awk-NL-prop for AWK Mode, here.
!                                         ; Something like c-awk-backward-syntactic-ws.
!                                         ; 2002/6/22.  Doesn't matter!  Leave it as it is.
  	       (/= (skip-chars-backward "-+!*&~@`#") 0))) ; ACM, 2002/5/31;
  							  ; Make a variable in
  							  ; cc-langs.el, maybe
--- 509,517 ----
        ;; that we've moved.
        (while (progn
  	       (setq pos (point))
!                (if (c-mode-is-new-awk-p)
!                    (c-awk-backward-syntactic-ws)
!                  (c-backward-syntactic-ws))
  	       (/= (skip-chars-backward "-+!*&~@`#") 0))) ; ACM, 2002/5/31;
  							  ; Make a variable in
  							  ; cc-langs.el, maybe
***************
*** 820,826 ****
        ;; Skip over the unary operators that can start the statement.
        (goto-char pos)
        (while (progn
! 	       (c-backward-syntactic-ws)
  	       (/= (skip-chars-backward "-+!*&~@`#") 0)) ; Hopefully the # won't hurt awk.
  	(setq pos (point)))
        (goto-char pos)
--- 819,827 ----
        ;; Skip over the unary operators that can start the statement.
        (goto-char pos)
        (while (progn
! 	       (if (c-mode-is-new-awk-p)
!                    (c-awk-backward-syntactic-ws)
!                  (c-backward-syntactic-ws))
  	       (/= (skip-chars-backward "-+!*&~@`#") 0)) ; Hopefully the # won't hurt awk.
  	(setq pos (point)))
        (goto-char pos)
*************************************************************************

-- 
Alan Mackenzie (Munich, Germany)

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

* Re: CC Mode 5.30.1 (Message); new cc-awk mode indentation wrong after ++
  2003-07-07  7:44     ` Alan Mackenzie
@ 2003-07-08 14:28       ` Richard Stallman
  2003-07-08 15:41         ` Stefan Monnier
  0 siblings, 1 reply; 10+ messages in thread
From: Richard Stallman @ 2003-07-08 14:28 UTC (permalink / raw
  Cc: miles, emacs-devel, bug-cc-mode

    I sent this patch off as a quick fix for Miles, who had reported the bug.
    (But yes, I should have used the -c format, for which see below.)  But
    surely what should be installed in the Emacs CVS are the controlled
    mini-releases, 5.30.n, rather than wild one-off patches.

If a mini-release can get installed soon, that would be better.
Otherwise I'd rather have this one-off patch than no fix at all.


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01


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

* Re: CC Mode 5.30.1 (Message); new cc-awk mode indentation wrong after ++
  2003-07-08 14:28       ` Richard Stallman
@ 2003-07-08 15:41         ` Stefan Monnier
  2003-07-08 23:36           ` Miles Bader
  0 siblings, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2003-07-08 15:41 UTC (permalink / raw
  Cc: Alan Mackenzie, miles, emacs-devel, bug-cc-mode

>     I sent this patch off as a quick fix for Miles, who had reported the bug.
>     (But yes, I should have used the -c format, for which see below.)  But
>     surely what should be installed in the Emacs CVS are the controlled
>     mini-releases, 5.30.n, rather than wild one-off patches.
> 
> If a mini-release can get installed soon, that would be better.
> Otherwise I'd rather have this one-off patch than no fix at all.

I think the part that you missed is that the indentation bug
is not a new bug.  It's just that the indentation was so poor before
that nobody would have bothered to look at such details.
There's really no hurry to install this patch as long as it
gets installed reasonably soon.


	Stefan



-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps


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

* Re: CC Mode 5.30.1 (Message); new cc-awk mode indentation wrong after ++
  2003-07-08 15:41         ` Stefan Monnier
@ 2003-07-08 23:36           ` Miles Bader
  2003-07-09 11:03             ` Martin Stjernholm
  0 siblings, 1 reply; 10+ messages in thread
From: Miles Bader @ 2003-07-08 23:36 UTC (permalink / raw
  Cc: Richard Stallman, Alan Mackenzie, emacs-devel, bug-cc-mode

On Tue, Jul 08, 2003 at 11:41:55AM -0400, Stefan Monnier wrote:
> There's really no hurry to install this patch as long as it
> gets installed reasonably soon.

Yeah, and it only happens on rare occasions anyway.  The only reason I
noticed it was that I was having so much fun with the new mode that I went
and reindented some of my awk files and did a diff against the old
hand-indented versions -- and those one or two lines were the only
differences (well actually the new mode _also_ cleans up backslash line
continuations nicely, something I never bothered to do by hand)!

In `normal' use, I think I probably wouldn't have encountered it for a long
time; I'm happy to wait for a new CC release.

-Miles
-- 
Saa, shall we dance?  (from a dance-class advertisement)


-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps


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

* Re: CC Mode 5.30.1 (Message); new cc-awk mode indentation wrong after ++
  2003-07-08 23:36           ` Miles Bader
@ 2003-07-09 11:03             ` Martin Stjernholm
  2003-07-09 23:47               ` Richard Stallman
  2003-07-10  2:09               ` Miles Bader
  0 siblings, 2 replies; 10+ messages in thread
From: Martin Stjernholm @ 2003-07-09 11:03 UTC (permalink / raw
  Cc: Stefan Monnier, Richard Stallman, Alan Mackenzie, emacs-devel,
	bug-cc-mode

Miles Bader <miles@gnu.org> wrote:

> In `normal' use, I think I probably wouldn't have encountered it for a long
> time; I'm happy to wait for a new CC release.

FYI, I installed this fix among a couple other yesterday.

Btw, I take it the new AWK mode is well received, so noone will object
if I remove the old one now?


-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps


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

* Re: CC Mode 5.30.1 (Message); new cc-awk mode indentation wrong after ++
  2003-07-09 11:03             ` Martin Stjernholm
@ 2003-07-09 23:47               ` Richard Stallman
  2003-07-10  2:09               ` Miles Bader
  1 sibling, 0 replies; 10+ messages in thread
From: Richard Stallman @ 2003-07-09 23:47 UTC (permalink / raw
  Cc: miles, monnier+gnu/emacs, acm, emacs-devel, bug-cc-mode

    Btw, I take it the new AWK mode is well received, so noone will object
    if I remove the old one now?

Please move it into the `obsolete' subdirectory.


-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps


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

* Re: CC Mode 5.30.1 (Message); new cc-awk mode indentation wrong after ++
  2003-07-09 11:03             ` Martin Stjernholm
  2003-07-09 23:47               ` Richard Stallman
@ 2003-07-10  2:09               ` Miles Bader
  1 sibling, 0 replies; 10+ messages in thread
From: Miles Bader @ 2003-07-10  2:09 UTC (permalink / raw
  Cc: Stefan Monnier, Richard Stallman, Alan Mackenzie, emacs-devel

Martin Stjernholm <mast@lysator.liu.se> writes:
> Btw, I take it the new AWK mode is well received, so noone will object
> if I remove the old one now?

Fine with me; though I'm a heavy user of awk, the old mode was not
really very useful.

-Miles
-- 
`...the Soviet Union was sliding in to an economic collapse so comprehensive
 that in the end its factories produced not goods but bads: finished products
 less valuable than the raw materials they were made from.'  [The Economist]


-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps


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

end of thread, other threads:[~2003-07-10  2:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-04  1:28 CC Mode 5.30.1 (Message); new cc-awk mode indentation wrong after ++ Miles Bader
2003-07-06 15:02 ` Alan Mackenzie
2003-07-07  3:39   ` Richard Stallman
2003-07-07  7:44     ` Alan Mackenzie
2003-07-08 14:28       ` Richard Stallman
2003-07-08 15:41         ` Stefan Monnier
2003-07-08 23:36           ` Miles Bader
2003-07-09 11:03             ` Martin Stjernholm
2003-07-09 23:47               ` Richard Stallman
2003-07-10  2:09               ` Miles Bader

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