all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* what might stop cperl-mode from indenting?
@ 2004-07-23  3:59 David Combs
  2004-07-31  0:10 ` David Combs
  2004-08-01 13:18 ` Kai Grossjohann
  0 siblings, 2 replies; 3+ messages in thread
From: David Combs @ 2004-07-23  3:59 UTC (permalink / 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

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

* Re: what might stop cperl-mode from indenting?
  2004-07-23  3:59 what might stop cperl-mode from indenting? David Combs
@ 2004-07-31  0:10 ` David Combs
  2004-08-01 13:18 ` Kai Grossjohann
  1 sibling, 0 replies; 3+ messages in thread
From: David Combs @ 2004-07-31  0:10 UTC (permalink / raw)


In article <cdq2ea$2lf$1@panix2.panix.com>,
David Combs <dkcombs@panix.com> wrote:
>
>what might stop cperl-mode from indenting?
>
snip

Well, I never found out why -- but I solved it!

How?  By grabbing the cperl-mode.el from 21.3 -- much
more code, and it works better -- *much* better.

Thanks to Ilya!

David

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

* Re: what might stop cperl-mode from indenting?
  2004-07-23  3:59 what might stop cperl-mode from indenting? David Combs
  2004-07-31  0:10 ` David Combs
@ 2004-08-01 13:18 ` Kai Grossjohann
  1 sibling, 0 replies; 3+ messages in thread
From: Kai Grossjohann @ 2004-08-01 13:18 UTC (permalink / raw)


dkcombs@panix.com (David Combs) writes:

> what might stop cperl-mode from indenting?

It might misparse the Perl code.  Perl has strange syntax, so that
parsing it is easy to get wrong.  For example, $/ is a variable, but
not in the expression m/foo$/.

Kai

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

end of thread, other threads:[~2004-08-01 13:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-23  3:59 what might stop cperl-mode from indenting? David Combs
2004-07-31  0:10 ` David Combs
2004-08-01 13:18 ` Kai Grossjohann

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.