[Top][All Lists]

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

Re: Spaces rather than tabs by a major mode hook

From: goncholden
Subject: Re: Spaces rather than tabs by a major mode hook
Date: Sun, 12 Jun 2022 00:07:29 +0000

------- Original Message -------
On Sunday, June 12th, 2022 at 9:56 AM, goncholden <> 

> ------- Original Message -------
> On Sunday, June 12th, 2022 at 9:36 AM, Dmitry Gutov wrote:
> > On 12.06.2022 00:17, goncholden wrote:
> >
> > > I have tried that. You get encouraged it might work. Until you press 
> > > return on the end of the line. Then emacs deletes all the tabs.
> >
> > Aaand you can disable 'electric-indent-mode' to get rid of this behavior.
> >
> > > Emacs should have a minor-mode or settings that only keep the 
> > > highlighting for the specific major-mode, and allows the user
> > > to format as one pleases.
> >
> > The general expectation is that our users's projects adhere to some
> > common rules WRT indentation, with only a few parameters varying between
> > them (which can be customized). When that holds, Emacs's way is way more
> > efficient in practice.
> That expectation is wrong for legacy code, particularly in fortran.
> > And when one works on a rare exception, they can tweak their config
> > accordingly. A minor mode could be helpful, I suppose, but the
> > customizations I suggested are fairly easy to do already.
> They are easy to do but they are not enough. Because at some deep level emacs 
> expectation users's projects to adhere to a sytle. That only works for single 
> person works or multi-person works who actually adhere to a style. In this 
> files, the style they adhere to relate only to naming conventions and that 
> code is uppercase. And obviously, that usual column position rules.

The defeating part is that even if I introduce TABs with

(global-set-key (kbd "TAB") (kbd "C-q TAB"))


(local-set-key (kbd "TAB") 'self-insert-command)

and using

(setq tab-always-indent nil)

all tabs get forcefully removed once one hits return at end of line.  I could 
be that emacs introduces some indentation spaces on the next line but to then 
remove all tabs on the previous line is excessive.

reply via email to

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