From: Richard Stallman <rms@gnu.org>
Subject: [f_frederic_f_52@yahoo.fr: trouble with perl indentation]
Date: Thu, 12 May 2005 04:30:35 -0400 [thread overview]
Message-ID: <E1DW95X-00072b-GT@fencepost.gnu.org> (raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2932 bytes --]
If someone is interested in working on Perl mode,
here's something to do.
------- Start of forwarded message -------
Date: Wed, 11 May 2005 11:30:49 +0200 (CEST)
From: na frederic <f_frederic_f_52@yahoo.fr>
To: bug-gnu-emacs@gnu.org
Subject: trouble with perl indentation
Sender: bug-gnu-emacs-bounces+rms=gnu.org@gnu.org
X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on monty-python
X-Spam-Level: ***
X-Spam-Status: No, hits=3.0 required=5.0 tests=FROM_ENDS_IN_NUMS,
FROM_HAS_ULINE_NUMS autolearn=no version=2.63
there is a trouble when i try to indent the folowing
code, this is due to the search of a regexp containing
a "}" in a file.
Regards,
frédéric
- ----- bad indented code: -----------------------------
# pour chaque nom de fichier passé en paramètre.
foreach $arg (@ARGV)
{
# si ce fichier existe
if (-e $arg)
{
# on ouvre le fichier.
open(FICHIERACT, "<" . $arg)
|| die "Erreur " . $arg . ", $!.\n";
$action = $noname;
while(<FICHIERACT>)
{
# si on trouve une ligne d'action
# alors on calcul son nom est on l'ouvre.
if ($_ =~ /^action[ \t]+.*$/)
{
$act_open = $vrai;
$action = &nom_action($_);
open(ACTION,">" .$action)
|| die "Erreur " . $action . ", $!.\n";
}
if ($act_open == $vrai)
{
syswrite(ACTION,$_,length($_));
}
# >>>>> folowing line cause indent trouble:
if ($_ =~ /^[ \t]*\`};$/)
{
$act_open = $faux;
close ACTION;
}
}
if ($act_open == $vrai)
{
close ACTION;
}
close FICHIERACT;
}
else
{
print "Warning $arg n'existe pas!";
}
}
- ----------- the corect indentation should be : -------
# pour chaque nom de fichier passé en paramètre.
foreach $arg (@ARGV)
{
# si ce fichier existe
if (-e $arg)
{
# on ouvre le fichier.
open(FICHIERACT, "<" . $arg)
|| die "Erreur " . $arg . ", $!.\n";
$action = $noname;
while(<FICHIERACT>)
{
# si on trouve une ligne d'action
# alors on calcul son nom est on l'ouvre.
if ($_ =~ /^action[ \t]+.*$/)
{
$act_open = $vrai;
$action = &nom_action($_);
open(ACTION,">" .$action)
|| die "Erreur " . $action . ", $!.\n";
}
if ($act_open == $vrai)
{
syswrite(ACTION,$_,length($_));
}
if ($_ =~ /^[ \t]*\`};$/)
{
$act_open = $faux;
close ACTION;
}
}
if ($act_open == $vrai)
{
close ACTION;
}
close FICHIERACT;
}
else
{
print "Warning $arg n'existe pas!";
}
}
- ---------------- end ---------------------------------
__________________________________________________________________
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/
_______________________________________________
Bug-gnu-emacs mailing list
Bug-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs
------- End of forwarded message -------
reply other threads:[~2005-05-12 8:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1DW95X-00072b-GT@fencepost.gnu.org \
--to=rms@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).