all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ergus <spacibba@aol.com>
To: Alan Mackenzie <acm@muc.de>
Cc: emacs-devel@gnu.org
Subject: Re: Supporting tabs for indentation, spaces for alignment
Date: Fri, 12 Apr 2019 19:00:44 +0200	[thread overview]
Message-ID: <20190412170044.4b3rticymd36qkox@Ergus> (raw)
In-Reply-To: <20190412155442.GD4588@ACM>

On Fri, Apr 12, 2019 at 03:54:42PM +0000, Alan Mackenzie wrote:

Hi again:

>Hello, Ergus.
>
>On Thu, Apr 11, 2019 at 12:24:05 +0200, Ergus wrote:
>
>All of what you have just written is far more vague and abstract than
>your previous posts.
>
>Getting concrete again, my understanding (please correct me if I am
>wrong) of what you are suggesting is: "continuation" CC Mode source
>lines should be indented with tabs up to the indent position of the
>"main" line, and spaces after that.  For some value of "continuation"
>and "main" (see below).
>
Yes, I have seen only 3 alternatives so far (in my short experience)
which are:

1) The actual emacs default.

2) Add an extra tab to continuation lines and no align with spaces at
all (some projects don't like to mix tabs with spaces, so they prefer
to ignore align)

3) Indent-with-tabs align with spaces.

>This might not be all that difficult to implement.  First the
>"continuation" CC Mode syntactic symbols (e.g. arglist-cont-nonempty)
>will need to be firmly identified, and a list made of them, say
>c-continuation-syntactic-symbols.
>
Ok, there are not too many right? For C++ I only remember
arglist-cont-nonempty, stream-op and template-args-cont.

>Then the writer of the CC Mode style will need to set a flag (which
>might be called c-limit-indentation-tabs or something like that) to
>non-nil in the style.  Also she will need to set indent-tabs-mode to
>non-nil.
>
Could we just add special values to indent-tabs-mode? So t is the
default (like now) and "limit-indentation-tabs" (or similar) will be
this policy? So for other possible future policies we just need to add
other values right? As it is buffer local should not affect other
modes.

>At run time, if the main symbol in the syntactic context is a member of
>c-continuation-syntactic-symbols, the column number of its anchor
>position will be determined.

This is what is not clear to me how to do it right. For example in case
of using templates.

>The CC Mode indenting function will not
>permit the initial sequence of tabs to extend beyond this anchor
>position, replacing such tabs with spaces beyond that point.
>
>> So the users could find their needs without writing 40 lisp lines and
>> read 20 manual pages full of therms that makes sense only after reading
>> 1000 previous pages. Or needing to install an external package that
>> potentially gets abandon.
>
>I think you're exaggerating just a little bit; it was only 27 lines of
>Lisp.  ;-)  But I take the point.  That workaround was only really
>suitable for a Lisp hacker.
>
Yes, maybe a little bit, I am from Latin America so it is normal for
us. We also use to write long emails and talk a lot :P

>Have you any views on my above proposed strategy?
>
If you give me the hints where in the code to implement the changes (As
Eli did for display-fill-column), maybe I can start with a draft
version. It will take a while because am not very lispy :(. But I think
these small features are very important and make the difference.
>-- 
>Alan Mackenzie (Nuremberg, Germany).

Very thanks for replying.
Ergus.



  reply	other threads:[~2019-04-12 17:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-11  9:02 Supporting tabs for indentation, spaces for alignment Alan Mackenzie
2019-04-11 10:24 ` Ergus
2019-04-11 13:29   ` Eli Zaretskii
2019-04-11 14:43     ` Ergus
2019-04-12 15:54   ` Alan Mackenzie
2019-04-12 17:00     ` Ergus [this message]
     [not found]     ` <b483d42ddde945b3a479800566aa257c@lanl.gov>
2019-04-13 13:54       ` Alan Mackenzie
2019-04-13 15:56         ` Ergus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190412170044.4b3rticymd36qkox@Ergus \
    --to=spacibba@aol.com \
    --cc=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.