all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Change line continuation behavior in cperl-mode
@ 2008-12-09 17:06 Steve
  2008-12-09 23:43 ` Xah Lee
  0 siblings, 1 reply; 6+ messages in thread
From: Steve @ 2008-12-09 17:06 UTC (permalink / raw
  To: help-gnu-emacs

Is there any way to change the indentation of continued lines (i.e.
lines ending in a ".") in cperl-mode? The current behavior is to add
an additional number of spaces to each continued line, so that, for
example, the second line is indented 2 characters, the next, 4, the
next, 6, etc, in an upside-down stair-step pattern. I'd like to have
all lines after the first indented the same (e.g. If the starting line
is at column 6, I'd like all the others to be at column 8). perl-mode
does this properly.

Thanks!

Steve


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

* Re: Change line continuation behavior in cperl-mode
  2008-12-09 17:06 Change line continuation behavior in cperl-mode Steve
@ 2008-12-09 23:43 ` Xah Lee
  2008-12-10 15:39   ` Steve
  0 siblings, 1 reply; 6+ messages in thread
From: Xah Lee @ 2008-12-09 23:43 UTC (permalink / raw
  To: help-gnu-emacs

On Dec 9, 9:06 am, Steve <swechs...@bigfoot.com> wrote:
> Is there any way to change the indentation of continued lines (i.e.
> lines ending in a ".") in cperl-mode? The current behavior is to add
> an additional number of spaces to each continued line, so that, for
> example, the second line is indented 2 characters, the next, 4, the
> next, 6, etc, in an upside-down stair-step pattern. I'd like to have
> all lines after the first indented the same (e.g. If the starting line
> is at column 6, I'd like all the others to be at column 8). perl-mode
> does this properly.

not sure, but have you tried customize-group with cperl?

in particular, there's a section on indentation with a lot variables
you can tweak.

in general, when behavior in some mode you don't like, first thing to
try is customize-group, followed by the mode name (may or may not end
in “-mode”). Not all major mode support this customize feature, but
most big ones or well written ones do.

  Xah
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Change line continuation behavior in cperl-mode
  2008-12-09 23:43 ` Xah Lee
@ 2008-12-10 15:39   ` Steve
  2008-12-10 18:35     ` Xah Lee
  0 siblings, 1 reply; 6+ messages in thread
From: Steve @ 2008-12-10 15:39 UTC (permalink / raw
  To: help-gnu-emacs

On Dec 9, 6:43 pm, Xah Lee <xah...@gmail.com> wrote:

> not sure, but have you tried customize-group withcperl?

Yes, that was the first thing I checked. There's nothing that
obviously applies to string continuation (not line continuation, which
works fine) on successive lines.

Steve


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

* Re: Change line continuation behavior in cperl-mode
  2008-12-10 15:39   ` Steve
@ 2008-12-10 18:35     ` Xah Lee
  2009-03-16  7:08       ` Alex
  0 siblings, 1 reply; 6+ messages in thread
From: Xah Lee @ 2008-12-10 18:35 UTC (permalink / raw
  To: help-gnu-emacs

On Dec 10, 7:39 am, Steve <swechs...@bigfoot.com> wrote:
> On Dec 9, 6:43 pm, Xah Lee <xah...@gmail.com> wrote:
>
> > not sure, but have you tried customize-group withcperl?
>
> Yes, that was the first thing I checked. There's nothing that
> obviously applies to string continuation (not line continuation, which
> works fine) on successive lines.


oh.

I looked into further your Q,... not sure what you mean though.

I tried this:


#perl
$some = "sme" .
    "what" .
    "that" .
    "and";
print $some;

but it seems to align? i'm not aware that perl line needs a dot to
signify continue? can you give a example?

  Xah
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Change line continuation behavior in cperl-mode
  2008-12-10 18:35     ` Xah Lee
@ 2009-03-16  7:08       ` Alex
  2009-03-17  2:38         ` Xah Lee
  0 siblings, 1 reply; 6+ messages in thread
From: Alex @ 2009-03-16  7:08 UTC (permalink / raw
  To: help-gnu-emacs

Xah Lee wrote:

> I tried this:
> 
> 
> #perl
> $some = "sme" .
>     "what" .
>     "that" .
>     "and";
> print $some;
> 
> but it seems to align? i'm not aware that perl line needs a dot to
> signify continue? can you give a example?

I'm having the same problem as Steve mentioned and I also noticed that 
sometimes it seems to work. Most importantly, I get the staircase effect 
inside a sub, but not outside.
Example:

my $s = "this"
     . " string"
     . " is"
     . " long";

sub bus {
     my $s = "this"
         . " string"
             . " goes on"
                 . " and on";
}

-- 
Alex
domain: iki dot fi
localpart: alext
email: localpart at domain


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

* Re: Change line continuation behavior in cperl-mode
  2009-03-16  7:08       ` Alex
@ 2009-03-17  2:38         ` Xah Lee
  0 siblings, 0 replies; 6+ messages in thread
From: Xah Lee @ 2009-03-17  2:38 UTC (permalink / raw
  To: help-gnu-emacs

On Mar 16, 12:08 am, Alex <check....@for.email.invalid> wrote:
> XahLeewrote:
> > I tried this:
>
> > #perl
> > $some = "sme" .
> >     "what" .
> >     "that" .
> >     "and";
> > print $some;
>
> > but it seems to align? i'm not aware that perl line needs a dot to
> > signify continue? can you give a example?
>
> I'm having the same problem as Steve mentioned and I also noticed that
> sometimes it seems to work. Most importantly, I get the staircase effect
> inside a sub, but not outside.
> Example:
>
> my $s = "this"
>      . " string"
>      . " is"
>      . " long";
>
> sub bus {
>      my $s = "this"
>          . " string"
>              . " goes on"
>                  . " and on";
>
> }

I reproduced it. Don't know how to solve. Looks like its by design.

  Xah
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-03-17  2:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-09 17:06 Change line continuation behavior in cperl-mode Steve
2008-12-09 23:43 ` Xah Lee
2008-12-10 15:39   ` Steve
2008-12-10 18:35     ` Xah Lee
2009-03-16  7:08       ` Alex
2009-03-17  2:38         ` Xah Lee

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.