emacs-devel
[Top][All Lists]

Re: Indentation and visual-line-mode

 From: Eli Zaretskii Subject: Re: Indentation and visual-line-mode Date: Fri, 25 Nov 2011 13:52:37 +0200

> From: Tassilo Horn <address@hidden>
> Date: Fri, 25 Nov 2011 10:34:25 +0100
>
> --8<---------------cut here---------------start------------->8---
>   \begin{itemize}
>   \item Foo bar baz foo
> bar baz foo
>   \item Bar baz foo bar
> baz
>   \end{itemize}
> --8<---------------cut here---------------end--------------->8---
>
> which looks pretty weird.  Is there some option that allows the wrapped
> lines to be visually indented relative to the current logical line?

I doubt that, because logical indentation and display-time wrap or
prefixing are two very different features on two very different
levels.  Logical indentation is actually present in the buffer, while
display-time features are produced by the display engine on the fly,
without any consideration of previous lines.

> Checking the docs, I think something like that can be achieved using the
> variables or text properties line-prefix' and wrap-prefix', but what
> is a stretch-glyph?

That's the empty space generated by the display engine when you use
:width, :relative-width, or :align-to display specs, see the node
"Specified Space" in the ELisp manual.  (I will clarify the text in
the manual in this regard.)  But the variables you mention are
supposed to have constant values, so you cannot put there a Lisp
expression that needs to be evaluated.  Therefore, I think you will
only be able to use them in your situation if you manually set them to
the amount of space derived from the logical indentation, or invoke
some hook that does that when the file is visited (assuming you never
want to change the indentation during editing).