unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Re: tabs with cperl-mode
       [not found] <mailman.3836.1118229884.25862.help-gnu-emacs@gnu.org>
@ 2005-06-08 20:00 ` Ilya Zakharevich
  2005-06-08 20:23   ` Martin Barth
  2005-06-08 21:44 ` Stefan Monnier
  1 sibling, 1 reply; 5+ messages in thread
From: Ilya Zakharevich @ 2005-06-08 20:00 UTC (permalink / raw)


[A complimentary Cc of this posting was sent to
Martin Barth
<martin@senfdax.de>], who wrote in article <mailman.3836.1118229884.25862.help-gnu-emacs@gnu.org>:
> hi everyone,
> 
> I need to just use tabs for indentiation with emacs and cperl_mode to stick
> to our coding style guide.
> I've search quite a while but i didnt found anything that could help me.
> 
> in http://www.gnu.org/software/emacs/manual/emacs.html#Just%20Spaces is
> decribed to use only spaces - i need the conserve way.
> 
> any suggestions?

Stop asking Emacs to indent with spaces.  The default on Emacs is to
indent with tabs.  CPerl does not indent itself, it just calculates
the amount of indentation, and asks Emacs to make the indentation.

Hope this helps,
Ilya

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

* Re: tabs with cperl-mode
  2005-06-08 20:00 ` tabs with cperl-mode Ilya Zakharevich
@ 2005-06-08 20:23   ` Martin Barth
  0 siblings, 0 replies; 5+ messages in thread
From: Martin Barth @ 2005-06-08 20:23 UTC (permalink / raw)


> Stop asking Emacs to indent with spaces.  
i never did that. ( well i think so )

> The default on Emacs is to indent with tabs.

even with no emacs config files there are spaces and tabs for indentation.
( if I indent for 8 "spaces" there is a \t instead of the spaces in the
files i saved.

maybe I'll try the save hock thing.. if i figure out how it works..

Thanks so far :)
Martin Barth

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

* Re: tabs with cperl-mode
       [not found] <mailman.3836.1118229884.25862.help-gnu-emacs@gnu.org>
  2005-06-08 20:00 ` tabs with cperl-mode Ilya Zakharevich
@ 2005-06-08 21:44 ` Stefan Monnier
  2005-06-09  7:06   ` Solved: " Martin Barth
       [not found]   ` <mailman.4009.1118301072.25862.help-gnu-emacs@gnu.org>
  1 sibling, 2 replies; 5+ messages in thread
From: Stefan Monnier @ 2005-06-08 21:44 UTC (permalink / raw)


> hi everyone, I need to just use tabs for indentiation with emacs and
> cperl_mode to stick to our coding style guide.  I've search quite a while
> but i didnt found anything that could help me.

> in http://www.gnu.org/software/emacs/manual/emacs.html#Just%20Spaces is
> decribed to use only spaces - i need the conserve way.

By default Emacs places TABs wherever it can when indenting lines.
So all you need to do is to make sure that it can always use TABs.
Since a TAB has a width corresponding to 8 characters, it means that you
should configure your major mode (in this case cperl-mode) to align
everything on multiples of 8.  I.e. start by setting cperl-indent-level
to 8.


        Stefan

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

* Solved: Re: tabs with cperl-mode
  2005-06-08 21:44 ` Stefan Monnier
@ 2005-06-09  7:06   ` Martin Barth
       [not found]   ` <mailman.4009.1118301072.25862.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 5+ messages in thread
From: Martin Barth @ 2005-06-09  7:06 UTC (permalink / raw)


> align everything on multiples of 8.  I.e. start by setting
> cperl-indent-level to 8.

I changed that. It works :) And i was confused again, because i had 

(setq tab-width 4)

in my .emacs . So I googled a bit and I found the solution.
so this works fine for me:

(setq cperl-continued-statement-offset 4)
(setq cperl-indent-level 4)
(setq cperl-tab-always-indent t)
(setq default-tab-width 4)


thanks a lot for your help
Regards
Martin Barth

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

* Re: Solved: Re: tabs with cperl-mode
       [not found]   ` <mailman.4009.1118301072.25862.help-gnu-emacs@gnu.org>
@ 2005-06-09 14:47     ` Stefan Monnier
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2005-06-09 14:47 UTC (permalink / raw)


>> align everything on multiples of 8.  I.e. start by setting
>> cperl-indent-level to 8.

> I changed that. It works :) And i was confused again, because i had 

> (setq tab-width 4)

> in my .emacs . So I googled a bit and I found the solution.
> so this works fine for me:

> (setq cperl-continued-statement-offset 4)
> (setq cperl-indent-level 4)
> (setq cperl-tab-always-indent t)
> (setq default-tab-width 4)

Changing tab-width is asking for trouble.  Its normal meaning, agreed upon
by all programs is that the width of a TAB is 8, no more no less.  If you
change it, it'll mess something up at some point.

Changing default-tab-width is even worse.

At least do

   (add-hook 'cperl-mode-hook (lambda () (setq tab-width 4)))

so it's only fucked up in your cperl mode and not in the rest.


        Stefan

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

end of thread, other threads:[~2005-06-09 14:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.3836.1118229884.25862.help-gnu-emacs@gnu.org>
2005-06-08 20:00 ` tabs with cperl-mode Ilya Zakharevich
2005-06-08 20:23   ` Martin Barth
2005-06-08 21:44 ` Stefan Monnier
2005-06-09  7:06   ` Solved: " Martin Barth
     [not found]   ` <mailman.4009.1118301072.25862.help-gnu-emacs@gnu.org>
2005-06-09 14:47     ` Stefan Monnier

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).