all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Standardize tab width variables across major modes
@ 2013-04-30 18:22 Andrew Pennebaker
  2013-05-04 23:46 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Pennebaker @ 2013-04-30 18:22 UTC (permalink / raw)
  To: Emacs Help

[-- Attachment #1: Type: text/plain, Size: 1197 bytes --]

Many Emacs modes seem to obey tab-width, e.g. (setq-default tab-width 2).
But a few modes define their own variables for this:

* JavaScript https://github.com/mcandre/dotfiles/blob/master/.emacs#L251
<https://github.com/mcandre/dotfiles/blob/master/.emacs#L250>
* CSS https://github.com/mcandre/dotfiles/blob/master/.emacs#L252
* Python https://github.com/mcandre/dotfiles/blob/master/.emacs#L256
* Rust https://github.com/mcandre/dotfiles/blob/master/.emacs#L262
* Go https://github.com/mcandre/dotfiles/blob/master/.emacs#L266
* Erlang https://github.com/mcandre/dotfiles/blob/master/.emacs#L274
* Haskell https://github.com/mcandre/dotfiles/blob/master/.emacs#L277
* PostScript https://github.com/mcandre/dotfiles/blob/master/.emacs#L284
* Mozart/Oz https://github.com/mcandre/dotfiles/blob/master/.emacs#L287

Could we refactor these modes to use the standard variables
tab-width, indent-tabs-mode, and sws-tab-width? We can maintain backwards
compatibility by continuing to offer nonstandard variables
like js-indent-level, by deriving them from the standard variables.

... could we refactor sws-mode to derive sws-tab-width from tab-width?

-- 
Cheers,

Andrew Pennebaker
www.yellosoft.us

[-- Attachment #2: Type: text/html, Size: 5322 bytes --]

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

* Re: Standardize tab width variables across major modes
  2013-04-30 18:22 Standardize tab width variables across major modes Andrew Pennebaker
@ 2013-05-04 23:46 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2013-05-04 23:46 UTC (permalink / raw)
  To: help-gnu-emacs

> Many Emacs modes seem to obey tab-width, e.g. (setq-default tab-width 2).
> But a few modes define their own variables for this:

You then go on to describe something else than tab-width (which is the
display size of a TAB character in the buffer), namely the size of the
default indentation step.

Those two things are very different.

The default indentation step depends on the indentation style, which
tend to vary between languages (even for a single individual).

This said, I agree that we should try and standardize the "default
indentation step" variable used by the various major modes.

`smie-indent-basic' was kind of meant to be this, but it's pretty
difficult to combine the need to obey the old variable's name.


        Stefan




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

end of thread, other threads:[~2013-05-04 23:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-30 18:22 Standardize tab width variables across major modes Andrew Pennebaker
2013-05-04 23:46 ` Stefan Monnier

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.