bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#12188: 24.1; awk-mode eletric { incorrectly inserts newline


From: Glenn Morris
Subject: bug#12188: 24.1; awk-mode eletric { incorrectly inserts newline
Date: Wed, 15 Aug 2012 13:41:44 -0400
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

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"
}





reply via email to

[Prev in Thread] Current Thread [Next in Thread]