[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: indentation via text or overlay property?

From: Kevin Rodgers
Subject: Re: indentation via text or overlay property?
Date: Fri, 06 Jun 2003 10:23:46 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv: Gecko/20020406 Netscape6/6.2.2

Stefan Monnier wrote:

"Kevin" == Kevin Rodgers <address@hidden> writes:

Is there a way to implement indentation via a text property like left-margin
or an overlay property like before-string?

(put-text-property start end 'display '(space :align-to N))

will make the text between `start' and `end' appear like a space
that ends at column N.

Cool!  But since those spaces are displayed instead of the original text (not
in addition to it), I don't see how to use that to implement indentation.

For example, let's say I have a <foo> tag at the beginning of a line that I
want displayed at column 6.  If I specify '(space :align-to 5) for the
display property at the position of "<" in the buffer, it gets indented like
I want except that the "<" is no longer visible.  And apparently I can't use
a value like

        (list '(space :align-to N) (buffer-substring start end))

to get both the spaces and the original text displayed.

This is at least documented in the NEWS file of Emacs-21.1, and
I'd expect there to be something about it as well in the elisp manual.

Thanks for the pointers.  Is the correct way to test for this feature:

        (>= emacs-major-version 21)

<a href="mailto:&lt;kevin.rodgers&#64;;";>Kevin Rodgers</a>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]