unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Oliver Scholz <alkibiades@gmx.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Indenting Emacs Lisp only with tabs?
Date: Wed, 02 Sep 2009 19:19:53 +0200	[thread overview]
Message-ID: <4a9ea93d$0$31877$9b4e6d93@newsspool3.arcor-online.net> (raw)
In-Reply-To: m2my5d79ky.fsf@gmail.com

Helmut Eller <eller.helmut@gmail.com> writes:

> * Elena [2009-09-02 15:11+0200] writes:
>
>> On 2 Set, 12:56, Peter Dyballa <Peter_Dyba...@Web.DE> wrote:
>>> Am 02.09.2009 um 12:38 schrieb Elena:
>>>
>>> > I'd like to use a proportional font, but that messes up indentation.
>>>
>>> That's the trouble with proportional fonts...
>>
>> Well, that's a trouble with editors - like Emacs - where you can't
>> move characters with pixel precision.
>
> To me it seems more like a limitation of text files.
>
>> However, if the indenting function does not try to overcome editor's
>> limitations by adding spaces to line things up, tabs work quite well.
>
> You can set tab-width to 1 and the indent function will only insert
> tabs.  It's more common though, to not use tabs at all by disabling
> indent-tab-mode.

Not a good idea, though, if anybody else (including a future self which
uses a different editor) is ever supposed to read that code.

> However, the indent function doesn't control how existing files are
> displayed and that's the trouble with proportional fonts: code that uses
> tabs and spaces looks messed up.

I actually thought about this some time ago. I believe it would be
possible, not really complicated even, to fix this. Emacs could simply
put a display property with the value

`(space :align-to <number of whitespace chars from line beginning to first non-whitespace>)

on the leading space or tab characters on each line. And there you go:
proportional fonts with flawless indentation.

The only complication would be that font-lock does not naturally handle
the `display' property; but if my memory serves well, all the necessary
mechanics are in place and this would only be a minor obstacle.


    Oliver
-- 
16 Fructidor an 217 de la Révolution
Liberté, Egalité, Fraternité!


  parent reply	other threads:[~2009-09-02 17:19 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-02 10:38 Indenting Emacs Lisp only with tabs? Elena
2009-09-02 12:56 ` Peter Dyballa
     [not found] ` <mailman.5848.1251896183.2239.help-gnu-emacs@gnu.org>
2009-09-02 13:11   ` Elena
2009-09-02 13:35     ` Helmut Eller
2009-09-02 13:54       ` Elena
2009-09-02 17:19       ` Oliver Scholz [this message]
2009-09-04  5:51         ` Oliver Scholz
2009-09-04  7:37           ` Elena
2009-09-04 10:14             ` Oliver Scholz
2009-09-02 14:06     ` Peter Dyballa
     [not found]     ` <mailman.5856.1251900422.2239.help-gnu-emacs@gnu.org>
2009-09-02 14:25       ` Elena
2009-09-02 15:15         ` Peter Dyballa
     [not found]         ` <mailman.5867.1251904529.2239.help-gnu-emacs@gnu.org>
2009-09-02 15:31           ` Elena
2009-09-02 17:15         ` Helmut Eller
2009-09-03  8:11         ` Joost Kremers
2009-09-03 12:17           ` B Smith-Mannschott
     [not found]           ` <mailman.5938.1251980288.2239.help-gnu-emacs@gnu.org>
2009-09-03 14:02             ` Elena
2009-09-03 18:46             ` Joost Kremers
2009-09-03 19:05               ` Elena

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='4a9ea93d$0$31877$9b4e6d93@newsspool3.arcor-online.net' \
    --to=alkibiades@gmx.de \
    --cc=help-gnu-emacs@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).