emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Run hook when variable is set


From: Stefan Monnier
Subject: Re: [PATCH] Run hook when variable is set
Date: Sat, 31 Jan 2015 23:05:08 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

>> For the same reason I want to kill the `intangible' text-property:
>> this operates at too-low a level, so it's bound to introduce buggy
>> interactions between unsuspecting packages.
> So what is now the best way to achieve the same effects/behaviours as
> the 'intangible' text-property?

You can use a post-command-hook or pre-redisplay-function, for example.

We already have code to do those kinds of things for properties such as
`invisible' (run right after post-command-hook, under the control of
disable-point-adjustment) and we should extend it for a new property,
which we could call `cursor-intangible'.

> One of the packages i maintain uses 'intangible' on some text in
> a minibuffer, to facilitate movement between the two fields whose
> contents users can modify: left- and right-movement doesn't move point
> through individual characters of non-modifiable text, but moves point
> past the entirety of that text.

Exactly: like 99.99% of all uses of `intangible', you use it to affect
cursor motion, i.e. motion at the command level, whereas intangible
affects motion at the function level (i.e. motions that happen within
commands, sometimes thousands of such motions within a single command,
some of those motions may happen in different buffers).


        Stefan



reply via email to

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