all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ergus <spacibba@aol.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Joost Kremers <joostkremers@fastmail.fm>, emacs-devel@gnu.org
Subject: Re: highlight-indent-guides in display engine
Date: Mon, 15 Jul 2019 16:11:07 +0200	[thread overview]
Message-ID: <20190715141107.sygnfsikmyeuzg3w@Ergus> (raw)
In-Reply-To: <jwvwogjpifm.fsf-monnier+emacs@gnu.org>

On Mon, Jul 15, 2019 at 08:58:00AM -0400, Stefan Monnier wrote:
>> But with this minimal support at least there will be something "good
>> enough" for C and all the derived from cc-mode (Java, C++, Ruby, Perl,
>> Lua) plus Python, Latex, Makefiles, Bash, Tcl, SQL, Assembly, Rust. So,
>> many users will be benefited... I think it is still a good deal right?.
>
Hi Stefan:

First, what I propose is not a general solution for all the cases,
actually it is VERY restrictive, but we don't have anything better and
efficient enough.

Your example is a typical example of indent + align and the emacs align
policy to mix spaces and tabs is actually the worst possible (in my very
modest opinion) I suppose there is an historical reason for it... But I
won't argue about it (there is a recent thread I started about that and
Alan gave a nice workaround (which for me should be like the default
when using tabs)).

In the general situation the indent will be a fix number of spaces >=2
|| a tab. And no lines will start, for example, in the half of the
indentation which in lisp happens very often (for example when there are
two opening parenthesis together).

Your example actually breaks very short lines into pieces, but it will
look like this more or less:

int main ()
{
  sfgasfgasfg(tot(x
  |  |  |  |  |  |+ 3),
  |  |  |  |  |y);
}

But even in this way it is better than nothing and it is not much
different than what most of the other editors do right now. And in
python it is specially useful because a typical error is to mix spaces
with tabs due to opening a file edited somewhere else.

But also there are some people doing the same just setting:

whitespace-style '(face tabs tab-mark trailing)
whitespace-display-mappings	'((tab-mark 9 [?\u2502 9] [?\u2502 9])))

In whitespace mode, because it works and don't kills performance.

In any case, I just made a proposal, any improvement you think works
better is very very welcome.

Thanks for putting some interest on this,
Ergus

>I'm not sure I understand the problem that makes it work for those modes
>but not for Lisp.
>
>E.g. in C mode by default we get indentation of this form:
>
>    int main ()
>      {
>        sfgasfgasfg(tot(x
>                      + 3),
>                  y);
>      }
>
>How is this fundamentally different from what happens in Lisp?
>
>
>        Stefan
>



  reply	other threads:[~2019-07-15 14:11 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-06 21:17 highlight-indent-guides in display engine Ergus
2019-07-07 15:04 ` Eli Zaretskii
2019-07-11 19:06   ` Ergus
2019-07-11 19:15     ` Eli Zaretskii
2019-07-12  0:21       ` Ergus
2019-07-12  6:57         ` Eli Zaretskii
2019-07-12  9:58           ` Ergus
2019-07-12 10:36             ` Ergus
2019-07-12 13:45             ` Eli Zaretskii
2019-07-12 18:51               ` Ergus
2019-07-12 19:35                 ` Drew Adams
2019-07-13  6:59                 ` Eli Zaretskii
2019-07-13  8:32                   ` Joost Kremers
2019-07-13  8:38                     ` Eli Zaretskii
2019-07-13 21:37                       ` Joost Kremers
2019-07-14  5:37                         ` Eli Zaretskii
2019-07-15  5:44                           ` Joost Kremers
2019-07-14 12:56                         ` Ergus
2019-07-15 12:58                           ` Stefan Monnier
2019-07-15 14:11                             ` Ergus [this message]
2019-07-15 14:49                               ` Stefan Monnier
2019-07-15 17:10                                 ` Ergus
2019-07-15 18:43                                   ` Stefan Monnier
2019-07-16  8:06                                     ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2019-07-07 17:50 Keith David Bershatsky

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=20190715141107.sygnfsikmyeuzg3w@Ergus \
    --to=spacibba@aol.com \
    --cc=emacs-devel@gnu.org \
    --cc=joostkremers@fastmail.fm \
    --cc=monnier@iro.umontreal.ca \
    /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.