all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Spaces instead of tabs in new mode
@ 2009-06-16 12:06 Paulo J. Matos
  2009-06-16 12:30 ` Thierry Volpiatto
  0 siblings, 1 reply; 7+ messages in thread
From: Paulo J. Matos @ 2009-06-16 12:06 UTC (permalink / raw)
  To: emacs list

Hi,

I have programming and indent-line for my new major mode but tabs are
not shown as spaces and are too big. How can I program emacs to show
the tabs as spaces and have a way to program the number of spaces per
tab?

Thanks,

-- 
Paulo Jorge Matos - pocmatos at gmail.com
http://www.pmatos.net




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

* Re: Spaces instead of tabs in new mode
       [not found] <mailman.703.1245153994.2239.help-gnu-emacs@gnu.org>
@ 2009-06-16 12:15 ` Pascal J. Bourguignon
  2009-06-16 22:54   ` Paulo J. Matos
  0 siblings, 1 reply; 7+ messages in thread
From: Pascal J. Bourguignon @ 2009-06-16 12:15 UTC (permalink / raw)
  To: help-gnu-emacs

"Paulo J. Matos" <pocmatos@gmail.com> writes:

> Hi,
>
> I have programming and indent-line for my new major mode but tabs are
> not shown as spaces and are too big. How can I program emacs to show
> the tabs as spaces and have a way to program the number of spaces per
> tab?

M-x customize-variable RET tab-width RET
-- 
__Pascal Bourguignon__


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

* Re: Spaces instead of tabs in new mode
  2009-06-16 12:06 Spaces instead of tabs in new mode Paulo J. Matos
@ 2009-06-16 12:30 ` Thierry Volpiatto
  2009-06-16 22:49   ` Paulo J. Matos
  0 siblings, 1 reply; 7+ messages in thread
From: Thierry Volpiatto @ 2009-06-16 12:30 UTC (permalink / raw)
  To: help-gnu-emacs

Hi, you can put this in your .emacs:

,----
| (setq-default indent-tabs-mode nil)
`----

to avoid tab indenting.


"Paulo J. Matos" <pocmatos@gmail.com> writes:

> Hi,
>
> I have programming and indent-line for my new major mode but tabs are
> not shown as spaces and are too big. How can I program emacs to show
> the tabs as spaces and have a way to program the number of spaces per
> tab?
>
> Thanks,

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France





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

* Re: Spaces instead of tabs in new mode
  2009-06-16 12:30 ` Thierry Volpiatto
@ 2009-06-16 22:49   ` Paulo J. Matos
  2009-06-17  0:40     ` Drew Adams
  0 siblings, 1 reply; 7+ messages in thread
From: Paulo J. Matos @ 2009-06-16 22:49 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: help-gnu-emacs

On Tue, 2009-06-16 at 14:30 +0200, Thierry Volpiatto wrote:
> Hi, you can put this in your .emacs:
> 
> ,----
> | (setq-default indent-tabs-mode nil)
> `----
> 
> to avoid tab indenting.
> 

I programmed a new mode. Can't I say that specifically for this mode I
want this to always happen?

Cheers,

Paulo Matos

> 
> "Paulo J. Matos" <pocmatos@gmail.com> writes:
> 
> > Hi,
> >
> > I have programming and indent-line for my new major mode but tabs are
> > not shown as spaces and are too big. How can I program emacs to show
> > the tabs as spaces and have a way to program the number of spaces per
> > tab?
> >
> > Thanks,
> 





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

* Re: Spaces instead of tabs in new mode
  2009-06-16 12:15 ` Pascal J. Bourguignon
@ 2009-06-16 22:54   ` Paulo J. Matos
  0 siblings, 0 replies; 7+ messages in thread
From: Paulo J. Matos @ 2009-06-16 22:54 UTC (permalink / raw)
  To: Pascal J. Bourguignon; +Cc: help-gnu-emacs

On Tue, 2009-06-16 at 14:15 +0200, Pascal J. Bourguignon wrote:
> "Paulo J. Matos" <pocmatos@gmail.com> writes:
> 
> > Hi,
> >
> > I have programming and indent-line for my new major mode but tabs are
> > not shown as spaces and are too big. How can I program emacs to show
> > the tabs as spaces and have a way to program the number of spaces per
> > tab?
> 
> M-x customize-variable RET tab-width RET

OK, thanks. Should I set that variable in my new mode or should I leave
it to the user to set to whatever value it wants?

Cheers,

Paulo Matos





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

* RE: Spaces instead of tabs in new mode
  2009-06-16 22:49   ` Paulo J. Matos
@ 2009-06-17  0:40     ` Drew Adams
  2009-06-19 18:17       ` Paulo J. Matos
  0 siblings, 1 reply; 7+ messages in thread
From: Drew Adams @ 2009-06-17  0:40 UTC (permalink / raw)
  To: 'Paulo J. Matos', 'Thierry Volpiatto'; +Cc: help-gnu-emacs

> > (setq-default indent-tabs-mode nil) to avoid tab indenting.
>
> 
> I programmed a new mode. Can't I say that specifically for this mode I
> want this to always happen?

Put (setq indent-tabs-mode nil) in the function that turns on your mode (e.g.
`foo-mode').

This variable is automatically buffer-local, so when you use `setq' (not
`setq-default') to set it, you are setting it only in the current buffer, that
is, the buffer that is in your mode.





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

* Re: Spaces instead of tabs in new mode
  2009-06-17  0:40     ` Drew Adams
@ 2009-06-19 18:17       ` Paulo J. Matos
  0 siblings, 0 replies; 7+ messages in thread
From: Paulo J. Matos @ 2009-06-19 18:17 UTC (permalink / raw)
  To: Drew Adams; +Cc: help-gnu-emacs, Thierry Volpiatto

On Wed, Jun 17, 2009 at 1:40 AM, Drew Adams<drew.adams@oracle.com> wrote:
>> > (setq-default indent-tabs-mode nil) to avoid tab indenting.
>>
>>
>> I programmed a new mode. Can't I say that specifically for this mode I
>> want this to always happen?
>
> Put (setq indent-tabs-mode nil) in the function that turns on your mode (e.g.
> `foo-mode').
>
> This variable is automatically buffer-local, so when you use `setq' (not
> `setq-default') to set it, you are setting it only in the current buffer, that
> is, the buffer that is in your mode.
>
>

Great, that's what I wanted! :)


-- 
Paulo Jorge Matos - pocmatos at gmail.com
http://www.pmatos.net




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

end of thread, other threads:[~2009-06-19 18:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-16 12:06 Spaces instead of tabs in new mode Paulo J. Matos
2009-06-16 12:30 ` Thierry Volpiatto
2009-06-16 22:49   ` Paulo J. Matos
2009-06-17  0:40     ` Drew Adams
2009-06-19 18:17       ` Paulo J. Matos
     [not found] <mailman.703.1245153994.2239.help-gnu-emacs@gnu.org>
2009-06-16 12:15 ` Pascal J. Bourguignon
2009-06-16 22:54   ` Paulo J. Matos

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.