help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Indentation with spaces


From: goncholden
Subject: Re: Indentation with spaces
Date: Thu, 09 Jun 2022 03:12:06 +0000

------- Original Message -------
On Thursday, June 9th, 2022 at 3:08 PM, Emanuel Berg <incal@dataswamp.org> 
wrote:


> Skip Montanaro wrote:
>
> > As for TAB not inserting a literal TAB character,
> > indentation is controlled by the major mode. I believe that
> > for ELisp, the default indentation is just two spaces.
> > (Don't quote me on that though.)
>
>
> Why is `indent-tabs-mode' t by default? Tabs should not
> be used.

I agree and found it very annoying.  Could one request a change?


> Anyway here is how I do it:
>
> ;;; -- lexical-binding: t --
> ;;
> ;; this file:
> ;; https://dataswamp.org/~incal/emacs-init/tabs.el
>
> (defun untab-all ()
> (unless (member major-mode '(makefile-gmake-mode
> makefile-mode) ) ; exceptions
> (untabify (point-min) (point-max)))
> nil) ; "did not write buffer to disk"
>
> (setq-default tab-width 3)
>
> (setq-default indent-tabs-mode nil)
>
> (provide 'tabs)
>
> And then
>
> ;; (setq before-save-hook nil)
> (defun before-save-hook-f ()
> (untab-all)
> (delete-trailing-whitespace) )
> (add-hook 'before-save-hook #'before-save-hook-f)
>
> --
> underground experts united
> https://dataswamp.org/~incal



reply via email to

[Prev in Thread] Current Thread [Next in Thread]