GNU bug report logs - #12188
24.1; awk-mode eletric { incorrectly inserts newline

Previous Next

Packages: emacs, cc-mode;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Mon, 13 Aug 2012 00:42:01 UTC

Severity: minor

Found in version 24.1

Done: Leo <sdl.web <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Glenn Morris <rgm <at> gnu.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: Leo <sdl.web <at> gmail.com>, 12188 <at> debbugs.gnu.org
Subject: Re: bug#12188: 24.1; awk-mode eletric { incorrectly inserts newline
Date: Wed, 15 Aug 2012 13:41:44 -0400
Alan Mackenzie wrote:

> The current assumption is that the "{" starts the action for the pattern
> "NR==3".

I think that's his point (it sure would be helpful to get less terse bug
reports). awk-mode is not consistent with that assumption.

cat foo.awk:

#!/usr/bin/gawk -f

NF == 3 
{
    print "three fields" 
}

chmod 755 foo.awk

echo "1 2" | ./foo.awk
  -> three fields


To work correctly, it needs to be either:

NF == 3 \
{
    print "three fields"
}

or

NF == 3 {
  print "three fields"
}




This bug report was last modified 12 years and 307 days ago.

Previous Next


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