all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* perl mode
@ 2002-05-08 17:24 Gabriel C Millerd
  0 siblings, 0 replies; 13+ messages in thread
From: Gabriel C Millerd @ 2002-05-08 17:24 UTC (permalink / raw)



back in college when i evoked emacs on a non existant file such as
such as something.(pl|c|cpp|sh) it would have common text that would be
used to start such a file. such as #!/path/program and what not.

anyone direct me to where i can figure out how to do this for myself?
perferablly from my home directory and perferablly for perl mode?

thanks very much

---
Gabriel Millerd |      Power is not revealed by striking hard or striken
Plumber         |       often, but by striking true. --Honore de Balzac

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

* RE: perl mode
@ 2002-05-08 19:27 Bingham, Jay
  0 siblings, 0 replies; 13+ messages in thread
From: Bingham, Jay @ 2002-05-08 19:27 UTC (permalink / raw)


There is a package called template.el available at http://emacs-template.sourceforge.net/ that will probably do what you are looking to do.

J_)
C_)ingham
.    HP NonStop Servers Software QA
.    Austin, TX
. Language is the apparel in which your thoughts parade in public.
. Never clothe them in vulgar and shoddy attire. -Dr. George W. Crane-

 -----Original Message-----
From: 	Gabriel C Millerd [mailto:gmillerd@qualhost.com] 
Sent:	Wednesday, 08 May, 2002 12:24 p
To:	help-gnu-emacs@gnu.org
Subject:	perl mode


back in college when i evoked emacs on a non existant file such as
such as something.(pl|c|cpp|sh) it would have common text that would be
used to start such a file. such as #!/path/program and what not.

anyone direct me to where i can figure out how to do this for myself?
perferablly from my home directory and perferablly for perl mode?

thanks very much

---
Gabriel Millerd |      Power is not revealed by striking hard or striken
Plumber         |       often, but by striking true. --Honore de Balzac


_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnu-emacs

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

* perl mode
@ 2013-10-01 16:09 Philippe Delavalade
  2013-10-04  2:46 ` Stefan Monnier
  0 siblings, 1 reply; 13+ messages in thread
From: Philippe Delavalade @ 2013-10-01 16:09 UTC (permalink / raw)
  To: help-gnu-emacs

Hi all.

it's my first post on this list, so be kind with my english :-)

I have problems with indentation in perl mode when usign "$'" ; I guess it
comes from the "'"...

Here is a little example :

#!/usr/bin/perl -w

use strict;

$\ = "\n";
my $txt = 'Hello World !';

main
{
if(1)
{
($txt =~ m/Hello /) && (print "$'");
}
print "Bye";
}

exit(0);

If I run the "indent-region" command (after having marked the whole
script", identation is not correct.

I suspect I should add some lines in .emacs but I don't know which are the
right ones...

Thanks in advance for help.

-- 
Ph. Delavalade



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

* perl mode
@ 2013-10-02  5:00 Philippe Delavalade
  2013-10-02 17:10 ` Andreas Röhler
  0 siblings, 1 reply; 13+ messages in thread
From: Philippe Delavalade @ 2013-10-02  5:00 UTC (permalink / raw)
  To: help-gnu-emacs

Hi all.

it's my first post on this list, so be kind with my english :-)

I have problems with indentation in perl mode when usign "$'" ; I guess it
comes from the "'"...

Here is a little example :

#!/usr/bin/perl -w

use strict;

$\ = "\n";
my $txt = 'Hello World !';

main
{
if(1)
{
($txt =~ m/Hello /) && (print "$'");
}
print "Bye";
}

exit(0);

If I run the "indent-region" command (after having marked the whole
script", identation is not correct.

I suspect I should add some lines in .emacs but I don't know which are the
right ones...

Thanks in advance for help.

-- 
Ph. Delavalade



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

* Re: perl mode
       [not found] <mailman.3253.1380707680.10748.help-gnu-emacs@gnu.org>
@ 2013-10-02 12:06 ` Damien Wyart
  2013-10-02 12:23   ` Philippe Delavalade
                     ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Damien Wyart @ 2013-10-02 12:06 UTC (permalink / raw)
  To: help-gnu-emacs

* Philippe Delavalade <philippe.delavalade@orange.fr> in gnu.emacs.help:
> it's my first post on this list, so be kind with my english :-)

If you prefer writing in French, there is also a French newsgroup
related to Emacs : fr.comp.application.emacs.

> I have problems with indentation in perl mode when usign "$'" ;
> I guess it comes from the "'"...

I don't think so: removing it doesn't change the observed behavior.

> If I run the "indent-region" command (after having marked the whole
> script", identation is not correct. I suspect I should add some lines
> in .emacs but I don't know which are the right ones...

You can use cperl mode instead of perl, it is a bit more powerful. The
simplest way to do so is by adding this line to .emacs:

(defalias 'perl-mode 'cperl-mode)

A quick test shows that your example works better with cperl mode.

-- 
DW


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

* Re: perl mode
  2013-10-02 12:06 ` Damien Wyart
@ 2013-10-02 12:23   ` Philippe Delavalade
  2013-10-02 16:41   ` Philippe Delavalade
       [not found]   ` <mailman.3268.1380732091.10748.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 13+ messages in thread
From: Philippe Delavalade @ 2013-10-02 12:23 UTC (permalink / raw)
  To: help-gnu-emacs

Fisrt, I'm sorry to havec sent the same message twice but as the first one
didn't appear, I tried again.

Le mercredi 02 octobre à 14:06, Damien Wyart a écrit :
> * Philippe Delavalade <philippe.delavalade@orange.fr> in gnu.emacs.help:
> > it's my first post on this list, so be kind with my english :-)
> 
> If you prefer writing in French, there is also a French newsgroup
> related to Emacs : fr.comp.application.emacs.

Ok.

> 
> > I have problems with indentation in perl mode when usign "$'" ;
> > I guess it comes from the "'"...
> 
> I don't think so: removing it doesn't change the observed behavior.
> 
> > If I run the "indent-region" command (after having marked the whole
> > script", identation is not correct. I suspect I should add some lines
> > in .emacs but I don't know which are the right ones...
> 
> You can use cperl mode instead of perl, it is a bit more powerful. The
> simplest way to do so is by adding this line to .emacs:
> 
> (defalias 'perl-mode 'cperl-mode)
> 
> A quick test shows that your example works better with cperl mode.
> 
> -- 
> DW

Many thanks !

-- 
Ph. Delavalade



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

* Re: perl mode
  2013-10-02 12:06 ` Damien Wyart
  2013-10-02 12:23   ` Philippe Delavalade
@ 2013-10-02 16:41   ` Philippe Delavalade
       [not found]   ` <mailman.3268.1380732091.10748.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 13+ messages in thread
From: Philippe Delavalade @ 2013-10-02 16:41 UTC (permalink / raw)
  To: help-gnu-emacs

Le mercredi 02 octobre à 14:06, Damien Wyart a écrit :
> You can use cperl mode instead of perl, it is a bit more powerful. The
> simplest way to do so is by adding this line to .emacs:
> 
> (defalias 'perl-mode 'cperl-mode)

I did that and test different styles with cperl-set-style and prefered C++.

So I add the following line, based on the manual
(setq cperl-default-style "C++")

I have no error or warning when entering emacs but it does not work.

What is wrong ?

Thanks in advance.

-- 
Ph. Delavalade



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

* Re: perl mode
  2013-10-02  5:00 perl mode Philippe Delavalade
@ 2013-10-02 17:10 ` Andreas Röhler
  0 siblings, 0 replies; 13+ messages in thread
From: Andreas Röhler @ 2013-10-02 17:10 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org List

[-- Attachment #1: Type: text/plain, Size: 754 bytes --]

Am 02.10.2013 07:00, schrieb Philippe Delavalade:
> Hi all.
>
> it's my first post on this list, so be kind with my english :-)
>
> I have problems with indentation in perl mode when usign "$'" ; I guess it
> comes from the "'"...
>
> Here is a little example :
>
> #!/usr/bin/perl -w
>
> use strict;
>
> $\ = "\n";
> my $txt = 'Hello World !';
>
> main
> {
> if(1)
> {
> ($txt =~ m/Hello /) && (print "$'");
> }
> print "Bye";
> }
>
> exit(0);
>
> If I run the "indent-region" command (after having marked the whole
> script", identation is not correct.
>
> I suspect I should add some lines in .emacs but I don't know which are the
> right ones...
>
> Thanks in advance for help.
>

with cperl-mode indent-region default delivers this - see attachment

[-- Attachment #2: cperl.png --]
[-- Type: image/png, Size: 57537 bytes --]

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

* Re: perl mode
       [not found]   ` <mailman.3268.1380732091.10748.help-gnu-emacs@gnu.org>
@ 2013-10-02 17:14     ` Damien Wyart
  2013-10-03 16:19       ` Philippe Delavalade
  0 siblings, 1 reply; 13+ messages in thread
From: Damien Wyart @ 2013-10-02 17:14 UTC (permalink / raw)
  To: help-gnu-emacs

* Philippe Delavalade <philippe.delavalade@orange.fr> in gnu.emacs.help:
> So I add the following line, based on the manual
> (setq cperl-default-style "C++")

> I have no error or warning when entering emacs but it does not work.

You should use something like this:

(add-hook 'cperl-mode-hook (lambda() (cperl-set-style "C++")))

-- 
DW


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

* Re: perl mode
  2013-10-02 17:14     ` Damien Wyart
@ 2013-10-03 16:19       ` Philippe Delavalade
  0 siblings, 0 replies; 13+ messages in thread
From: Philippe Delavalade @ 2013-10-03 16:19 UTC (permalink / raw)
  To: help-gnu-emacs

Le mercredi 02 octobre à 19:14, Damien Wyart a écrit :
> * Philippe Delavalade <philippe.delavalade@orange.fr> in gnu.emacs.help:
> > So I add the following line, based on the manual
> > (setq cperl-default-style "C++")
> 
> > I have no error or warning when entering emacs but it does not work.
> 
> You should use something like this:
> 
> (add-hook 'cperl-mode-hook (lambda() (cperl-set-style "C++")))

Many thanks, it's fine now ; I mean : fine for me :-)

-- 
Ph. Delavalade



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

* Re: perl mode
  2013-10-01 16:09 Philippe Delavalade
@ 2013-10-04  2:46 ` Stefan Monnier
  2013-10-04 11:22   ` Luca Ferrari
       [not found]   ` <mailman.3390.1380885764.10748.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 13+ messages in thread
From: Stefan Monnier @ 2013-10-04  2:46 UTC (permalink / raw)
  To: Philippe Delavalade; +Cc: help-gnu-emacs

> #!/usr/bin/perl -w
> use strict;
> $\ = "\n";
> my $txt = 'Hello World !';
> main
> {
> if(1)
> {
> ($txt =~ m/Hello /) && (print "$'");
> }
> print "Bye";
> }
> exit(0);

> If I run the "indent-region" command (after having marked the whole
> script", identation is not correct.

As far as I can tell, the only problem is that perl-mode doesn't like to
start from a file with no indentation at all.  Check `perl-nochange',
which is a regexp that specifies lines that auto-indentation should
not change.  This includes all lines that start with ( or { or [.


        Stefan



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

* Re: perl mode
  2013-10-04  2:46 ` Stefan Monnier
@ 2013-10-04 11:22   ` Luca Ferrari
       [not found]   ` <mailman.3390.1380885764.10748.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 13+ messages in thread
From: Luca Ferrari @ 2013-10-04 11:22 UTC (permalink / raw)
  To: Philippe Delavalade; +Cc: help-gnu-emacs

> As far as I can tell, the only problem is that perl-mode doesn't like to
> start from a file with no indentation at all.

Correct. The same for cperl (the latest mode related to Perl 6).

Luca



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

* Re: perl mode
       [not found]   ` <mailman.3390.1380885764.10748.help-gnu-emacs@gnu.org>
@ 2013-10-04 18:55     ` Damien Wyart
  0 siblings, 0 replies; 13+ messages in thread
From: Damien Wyart @ 2013-10-04 18:55 UTC (permalink / raw)
  To: help-gnu-emacs

> > As far as I can tell, the only problem is that perl-mode doesn't
> > like to start from a file with no indentation at all.

* Luca Ferrari <fluca1978@infinito.it> in gnu.emacs.help:
> Correct. The same for cperl (the latest mode related to Perl 6).

No, as said in my first answer, cperl (with default settings and
emacs-snapshot) indents the file even if all the lines are initially at
the first column, as in the example.

-- 
DW


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

end of thread, other threads:[~2013-10-04 18:55 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-02  5:00 perl mode Philippe Delavalade
2013-10-02 17:10 ` Andreas Röhler
     [not found] <mailman.3253.1380707680.10748.help-gnu-emacs@gnu.org>
2013-10-02 12:06 ` Damien Wyart
2013-10-02 12:23   ` Philippe Delavalade
2013-10-02 16:41   ` Philippe Delavalade
     [not found]   ` <mailman.3268.1380732091.10748.help-gnu-emacs@gnu.org>
2013-10-02 17:14     ` Damien Wyart
2013-10-03 16:19       ` Philippe Delavalade
  -- strict thread matches above, loose matches on Subject: below --
2013-10-01 16:09 Philippe Delavalade
2013-10-04  2:46 ` Stefan Monnier
2013-10-04 11:22   ` Luca Ferrari
     [not found]   ` <mailman.3390.1380885764.10748.help-gnu-emacs@gnu.org>
2013-10-04 18:55     ` Damien Wyart
2002-05-08 19:27 Bingham, Jay
2002-05-08 17:24 Gabriel C Millerd

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.