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

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

Re: Spaces rather than tabs by a major mode hook


From: Eli Zaretskii
Subject: Re: Spaces rather than tabs by a major mode hook
Date: Sat, 11 Jun 2022 10:19:05 +0300

> Date: Fri, 10 Jun 2022 19:52:11 +0000
> From: goncholden <goncholden@protonmail.com>
> Cc: help-gnu-emacs@gnu.org
> 
> > > With "emacs -Q" I can only introduce a single tab. If a tab already 
> > > exists, the cursor goes to the start of the first character.
> >
> >
> > That's the intended and correct behavior of TAB in
> > programming-language modes. What is the problem with it?
> 
> It is a problem because the authors of the code used multiple tab inserts for 
> indentation as well.

When you visit that Fortran file, look at the "Fortran" item in the
menu bar.  Click Fortran->Customization->Fortran->Fortran Indent, and
you will see a menu that allows you to customize many aspects of the
indentation of Fortran source files.

Alternatively, type

  M-x customize-group RET fortran-indent RET

and you will be presented with a buffer showing the customizable
options that control indentation in buffers under Fortran mode.

By modifying these options to match the style used by the authors of
the files whcih you need to edit, you can resolve those issues once
and for all, such that typing TAB at the beginning of a line that is
already indented according to conventions will not change anything,
and indenting a new line you add will follow these conventions, like
using a literal TAB for each inner indentation level.  All it takes is
to customize the indentation such that indentation levels are on
multiples of 8 columns, then indent-tabs-mode set to t will insert
literal TABs automatically.  For example, there's an option that
customizes the indentation of the IF body, another option for DO body,
etc.

> This rejects the use of emacs outright.

Such a confidence from someone who has yet so much to learn about
Emacs in general and indentation in particular...

Given the state of your knowledge in the related areas of Emacs, may I
suggest some humility?  Like asking a question instead of knee-jerking
a reaction that is not based on reality in any way?  This could very
well result in more people answering your questions, and in your
learning what you need to learn much faster and more thoroughly.
Because helping someone with such an attitude is not a very satisfying
task.



reply via email to

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