[Top][All Lists]

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

Re: indentation via text or overlay property?

From: Stefan Monnier
Subject: Re: indentation via text or overlay property?
Date: 06 Jun 2003 15:29:38 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

> Good idea, especially because I want to avoid modifying the buffer.
> But I'm having problems getting overlays of size 0 to work.  Trying things
> out manually with M-:, I've only gotten the desired effect once.
> I'm trying things like:

> (let ((lbp (line-beginning-position)))
>    (overlay-put (make-overlay lbp lbp)
>              'display '(space :align-to 4)))

Does it work with text-properties ?  How about with a non-empty overlay ?
It's a part of the code that hasn't seen much use yet, so there might
be bugs.

> (let ((lbp (line-beginning-position)))
>    (overlay-put (make-overlay lbp lbp)
>              'string-before (make-string 4 ? )))

The `string-before' should be `before-string' and it should work
because it's been around (and used) for a long time.

>>> Thanks for the pointers.  Is the correct way to test for this feature:
>>> (>= emacs-major-version 21)
>> I think (featurep 'text-properties 'display) is better.

> | Debugger entered--Lisp error: (wrong-number-of-arguments #<subr featurep> 2)

Oops, looks like it didn't make it to Emacs-21.1, sorry.  I guess
testing emacs-major-version is not worse than anything else.


reply via email to

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