Loading ...
Sorry, an error occurred while loading the content.

455RE: [jasspa] Correction to hkperl.emf -- indenting $#foo

Expand Messages
  • Steven Phillips
    Sep 2, 2001
    • 0 Attachment
      Thanks for finding and fixing the problem (I'm still mulling over the narrow-buffer issue). This fix would work fine if the indent algorithm worked across lines but like the hilight code it works on a single line only. This means that the fix unfortunately gets the following case wrong:
      # sdfsdfsfd {
      # fsdgfdg
      When its at the left hand edge, this is because "[^$]#" now requires a character before the '#' which is not there when its at the start of a line. There are 2 ways to fix this, either exclude the "$#" first then ignore any '#' as before, i.e.:
          indent .hilight.perl e "\\$#" "." ""
          indent .hilight.perl i "#"  
      Or add another tag to match this special start of line case:
          indent .hilight.perl i "[^$]#"
          indent .hilight.perl i "^#"  
      Both work, but for efficiency the first is probably better as the tokens must start with either a '#' or '$' whereas the second can start with anything except a '$'.
      -----Original Message-----
      From: Thomas Hundt [mailto:thundt@...]
      Sent: Saturday, September 01, 2001 6:24 AM
      To: JASSPA MicroEmacs Mailing List
      Subject: [jasspa] Correction to hkperl.emf -- indenting $#foo

      The following code does not indent properly under the current version of hkperl.emf (010801):

      for (my $x = 0; $x <= $#foo; $x++)
               print "$foo[x]\n";

      (The braces should be flush left.)

      There is a line in hkperl that tells it to ignore everything after the '#' character, for the purposes of indentation.  This line does not take into account the above possibility (syntax for finding the number of elements in an array).  Fortunately, it's easy to fix:

      As-shipped:  (about the 4th line from the end of the file hkperl.emf)
          indent .hilight.perl i "#" 

          indent .hilight.perl i "[^$]#" 

      (I'm not sure if \# would ever come up in Perl, but if it would, the above should read "[^\\$]#".)

      Please verify and use as appropriate.


      Thomas Hundt <thundt@...> +1-415-643-3595


      This is an unmoderated list. JASSPA is not responsible for the content of

      any material posted to this list.

      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

    • Show all 2 messages in this topic