[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Indenting Emacs Lisp only with tabs?
From: |
Oliver Scholz |
Subject: |
Re: Indenting Emacs Lisp only with tabs? |
Date: |
Wed, 02 Sep 2009 19:19:53 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
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é!
- Indenting Emacs Lisp only with tabs?, Elena, 2009/09/02
- Re: Indenting Emacs Lisp only with tabs?, Peter Dyballa, 2009/09/02
- Message not available
- Re: Indenting Emacs Lisp only with tabs?, Elena, 2009/09/02
- Re: Indenting Emacs Lisp only with tabs?, Helmut Eller, 2009/09/02
- Re: Indenting Emacs Lisp only with tabs?, Elena, 2009/09/02
- Re: Indenting Emacs Lisp only with tabs?,
Oliver Scholz <=
- Re: Indenting Emacs Lisp only with tabs?, Oliver Scholz, 2009/09/04
- Re: Indenting Emacs Lisp only with tabs?, Elena, 2009/09/04
- Re: Indenting Emacs Lisp only with tabs?, Oliver Scholz, 2009/09/04
- Re: Indenting Emacs Lisp only with tabs?, Peter Dyballa, 2009/09/02
- Message not available
- Re: Indenting Emacs Lisp only with tabs?, Elena, 2009/09/02
- Re: Indenting Emacs Lisp only with tabs?, Peter Dyballa, 2009/09/02
- Message not available
- Re: Indenting Emacs Lisp only with tabs?, Elena, 2009/09/02
- Re: Indenting Emacs Lisp only with tabs?, Helmut Eller, 2009/09/02
- Re: Indenting Emacs Lisp only with tabs?, Joost Kremers, 2009/09/03
- Re: Indenting Emacs Lisp only with tabs?, B Smith-Mannschott, 2009/09/03