From: dkcombs@panix.com (David Combs)
Subject: what might stop cperl-mode from indenting?
Date: 22 Jul 2004 23:59:06 -0400 [thread overview]
Message-ID: <cdq2ea$2lf$1@panix2.panix.com> (raw)
what might stop cperl-mode from indenting?
emacs-version is 21.2 (from the solaris-9 complimentary-software cd),
and these 5 lines from /opt/sfw/share/emacs/21.2/lisp/progmodes/cperl-mode.el:
> (defgroup cperl nil
> "Major mode for editing Perl code."
> :prefix "cperl-"
> :group 'languages
> :version "20.3")
. Works fine when sub-foo is the *sole* thing in a file ("t.pl"):
Given this:
> sub foo {
> my $dbg=0;
> $x=5;
> }
If I put the cursor at the my-line left-margin, and hit TAB, then, as
expected, I'm left with this:
> sub foo {
> my $dbg=0;
> our $x=5;
> }
Futher, M-x cperl-indent-region works just fine,
leaving me with this:
> sub foo {
> my $dbg=0;
> our $x=5;
> }
. Whereas with the a larger (and problematic) perl file (that I'm
working on), when I place that sub-foo between two functions, indenting
doesn't work.
Now, "show me the code that comes before that foo-sub", you demand.
Nope -- doesn't matter.
Because here's what's *really* wild: I get the same problems
*even* when I've *NARROWED* it to "be identical" to the above t.pl,
the narrowed-buffer being this:
>
> sub foo {
> my $dbg=0;
> $x=5;
> }
>
That is, if the my-line is flush left, then a tab-command
does *nothing*.
(QUESTION: What, cperl-mode has X-ray vision?)
NOTE THIS (hey, I learn slowly): Just now, while preparing this post
(off-line), I've discovered that when I have the cursor not at the
left margin (as before), but instead out to the *right* of the
my-line, and *then* I hit tab, it works differently!
It *does* indent that my-line!
And once that's happened, the $x-line indents ok, even with the
cursor at its left margin.
(We're not through yet -- it's still royally screwed up.)
(Well, sometimes something (in emacs) seems to go into a loop, until I
hit a ^G.
and "top" shows emacs going from 10% cpu to 92% (and still climbing,
when I did the ^G)
However, still in the big file, narrowed, with the my and $x lines
put back at the left margin, if I put the cursor out to the right
of the $x line and hit tab, emacs (or cperl.el) goes into a loop!
(The screen cursor turns into a wee clock-face; in another CDE-window,
top shows emacs growing from 10% of cpu up to 92$, at which
point I ^G emacs, and the cursor stops being a clock-face).
Likewise, perhaps as no surprise now, I can get into that loop doing
"M-x cperl-indent-region".
In this case the minibuf says "(indenting ... ( 6%))
And none of these problems happen in the small file, t.pl
QUESTION: what might be going wrong?
Thanks for any ideas!
David
next reply other threads:[~2004-07-23 3:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-23 3:59 David Combs [this message]
2004-07-31 0:10 ` what might stop cperl-mode from indenting? David Combs
2004-08-01 13:18 ` Kai Grossjohann
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='cdq2ea$2lf$1@panix2.panix.com' \
--to=dkcombs@panix.com \
/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.
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).