dockerfile-mode icon indicating copy to clipboard operation
dockerfile-mode copied to clipboard

Obey standard variables for indentation style

Open mcandre opened this issue 10 years ago • 5 comments

Emacs offers standard variables for configuring indentation styles, such as indent-tabs-mode and sws-tab-width. When an Emacs user configures these globally, it is expected that the different programming modes respect these settings. Unless overridden, please have dockerfile-mode inform its indentation settings to match indent-tabs-mode and sws-tab-width by default.

mcandre avatar Jul 13 '15 16:07 mcandre

You probably have (setq indent-tabs-mode nil) in your .emacs, you probably want

(setq-default indent-tabs-mode nil)

When using setq-default, dockerfile-mode does obey spaces in lieu of tabs.

I don't know anything about SWS (save for a quick duckduckgo'ing to find what sws-tab-width was), but it doesn't seem to be a standard emacs thing, so I don't know if there's some weird interaction between the standard emacs environment for tabs/spaces, etc. I would highly suspect that there's a standard emacs way to set the tab width, but I don't know it off hand.

drewcsillag avatar Jul 14 '15 15:07 drewcsillag

Er, I have this at the top of my .emacs:

(setq-default indent-tabs-mode nil
              tab-width 2)

mcandre avatar Aug 13 '15 00:08 mcandre

Issue gardening. @mcandre does #43 fix the issue? Can it be closed?

pataquets avatar Jan 11 '24 09:01 pataquets

@drewcsillag @mcandre pls close the report, it's fixed. I just tested: creating a buffer with

RUN foo \
    bar

and then indenting bar results in it being indented with spaces as that's the default style in my configuration. Enabling M-x indent-tabs-mode and pressing TAB re-indents it using tabs instead.

Hi-Angel avatar Feb 26 '24 11:02 Hi-Angel

@mcandre fancy to close the issue?

pataquets avatar Aug 11 '24 18:08 pataquets