perl mode in emacs - help 
Author Message
 perl mode in emacs - help

    G> Certain common forms of tkperl source seem to confuse the perl mode in
    G> emacs.

    G> The following:

    G> &tk'frame('.frame2');
    G> &tk'frame('.cframe');
    G> &tk'frame('.eframe');
    G> &tk'frame('.nframe');

    G> gets indented as:

    G> &tk'frame('.frame2');
    G>     &tk'frame('.cframe');
    G> &tk'frame('.eframe');
    G>     &tk'frame('.nframe');

    G> ie. every second line is correct.

    G> How do I fix this?

As far as I know there is no fix for this in emacs, since it needs to
recognize ' as the beginning of a quoted string, and can't judge from
context that it defines a package.

In perl 5 you use :: instead of '. I like that not only because emacs'
perl-mode can handle it, I think it looks better and makes more sense.

--

 (301) 286-2396                          fax: (301) 286-1754

"Tut! Tut!" cried Sherlock Holmes. "You must act, man, or you are
lost. Nothing but energy can save you. This is no time for dispair."



Mon, 28 Apr 1997 19:58:48 GMT  
 perl mode in emacs - help

Certain common forms of tkperl source seem to confuse the perl mode in
emacs.

The following:

&tk'frame('.frame2');
&tk'frame('.cframe');
&tk'frame('.eframe');
&tk'frame('.nframe');

gets indented as:

&tk'frame('.frame2');
    &tk'frame('.cframe');
&tk'frame('.eframe');
    &tk'frame('.nframe');

ie. every second line is correct.

How do I fix this?

Thanks in advance.
--

------------------------------------------------------------------
Greg VanSickle                        Northern Telecom Electronics
New Product Introduction              185 Corkstown Rd.          
phone: (613) 763-5160                 Nepean, Ontario
esn:    393-5160                      Canada K2H 8V4

fax: (613) 763-5730



Mon, 28 Apr 1997 06:03:09 GMT  
 perl mode in emacs - help
Try putting this in your .emacs file:

;;;;;;;;;;;;;;;;;;;
(load-library "perl-mode")

  ;; Like ' to be recognized part of package names
  (modify-syntax-entry ?' "w" perl-mode-syntax-table)
;;;;;;;;;;;;;;;;;;;

Someone posted it long ago, it solves most, possibly all, "'"
problems. The only (minor) annoyance I have with perl-mode in emacs is
with $num = $#var; constructs where "#var" appears in the comment
font.

I think that there has been too much emacs bashing in this newsgroup,
which is ironic to me because I often have to defend both Perl and
Emacs with the same group of people.



Thu, 08 May 1997 02:52:07 GMT  
 perl mode in emacs - help
: I think that there has been too much emacs bashing in this newsgroup,
: which is ironic to me because I often have to defend both Perl and
: Emacs with the same group of people.

Strange, since perl is a gift from the heavens, whereas emacs
traces it's lineage from another direction.  Let's face it,
emacs is to be depreciated, unless depricated.

We don't need no s{*filter*}king emacs.



Thu, 08 May 1997 10:36:31 GMT  
 perl mode in emacs - help

Quote:

>We don't need no s{*filter*}king emacs.

What would you suggest, vi?

--
Rodger Anderson



Fri, 09 May 1997 01:54:11 GMT  
 perl mode in emacs - help

: >We don't need no s{*filter*}king emacs.

: What would you suggest, vi?

What else?

A much misquoted historical incident.  Julius Ceasar, after conquering
Gaul, invaded the land of Emacs, and sent the first recorded e-mail to
Rome, "Veni, vidi, vomit."



Fri, 09 May 1997 03:34:19 GMT  
 perl mode in emacs - help

Quote:


>     G> Certain common forms of tkperl source seem to confuse the perl mode in
>     G> emacs.

>     G> The following:

>     G> &tk'frame('.frame2');
>     G> &tk'frame('.cframe');
>     G> &tk'frame('.eframe');
>     G> &tk'frame('.nframe');

>     G> gets indented as:

>     G> &tk'frame('.frame2');
>     G>     &tk'frame('.cframe');
>     G> &tk'frame('.eframe');
>     G>     &tk'frame('.nframe');

>     G> ie. every second line is correct.

>     G> How do I fix this?

> As far as I know there is no fix for this in emacs, since it needs to
> recognize ' as the beginning of a quoted string, and can't judge from
> context that it defines a package.

This has gotta be the most frequently asked question that's not in the
FAQ - hint, hint.  There is a very simple fix for this.  To make
perl-mode recognize the perl 4 package notation (i.e. ') simply put
the following in your .emacs file for emacs version 19

    (add-hook 'perl-mode-hook
              '(lambda ()
                 (modify-syntax-entry ?\' "_" perl-mode-syntax-table)))

or for emacs version 18

    (setq perl-mode-hook
          '(lambda ()
             (modify-syntax-entry ?\' "_" perl-mode-syntax-table)))

Note that this will cause perl-mode to get confused with some single
quoted strings that contain the following characters `" )( }{ ][ # but
you can easily deal with this by changing the single quoted string to
double quoted.

--
Jay Rogers
Ampersand Inc.



Sat, 10 May 1997 08:22:26 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Enhanced cperl-mode.el (Perl editing mode for Emacs)

2. Perl and Emacs question - perl debugging mode & cperl-mode vs perl-mode??

3. Perl mode for Emacs.

4. Perl editing mode in Lucid Emacs

5. emacs mode for perl

6. emacs perl-mode question

7. WANTED: A perl mode for emacs that actually works

8. emacs perl-mode??

9. perl-mode in Emacs 18.58 (or Lucid 19.6)

10. Perl mode for Emacs, Where?

11. perl mode for lucid emacs??

12. emacs perl mode?

 

 
Powered by phpBB® Forum Software