all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Showing text in a buffer only when point is in a region
@ 2017-01-28 12:33 Narendra Joshi
  2017-01-28 12:46 ` tomas
  0 siblings, 1 reply; 4+ messages in thread
From: Narendra Joshi @ 2017-01-28 12:33 UTC (permalink / raw)
  To: help-gnu-emacs


Hi,

I want to be able to keep some text visible in a buffer only when the
point is in a region. The moment the point leaves that region, I would
like to make the text invisible. How can I do this? I don't want to run
a timer which checks if the point is in the region or outside.

Best,
Narendra Joshi



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Showing text in a buffer only when point is in a region
  2017-01-28 12:33 Showing text in a buffer only when point is in a region Narendra Joshi
@ 2017-01-28 12:46 ` tomas
  2017-01-28 14:45   ` Stephen Berman
  0 siblings, 1 reply; 4+ messages in thread
From: tomas @ 2017-01-28 12:46 UTC (permalink / raw)
  To: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, Jan 28, 2017 at 06:03:57PM +0530, Narendra Joshi wrote:
> 
> Hi,
> 
> I want to be able to keep some text visible in a buffer only when the
> point is in a region. The moment the point leaves that region, I would
> like to make the text invisible. How can I do this? I don't want to run
> a timer which checks if the point is in the region or outside.

See "Overlays" or "Text Properties" in the Emacs Lisp manual. You can set
"point-entered" and "point-left" special properties (see "Properties with
Special Meanings", which are hooks to be called at those events.

Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAliMkpIACgkQBcgs9XrR2kZouwCfbsifIUe6EbXLmXRUR2DLT0xE
sqQAn1zxVcu0QAgeE7BrIW59syIqRN8k
=IsGC
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Showing text in a buffer only when point is in a region
  2017-01-28 12:46 ` tomas
@ 2017-01-28 14:45   ` Stephen Berman
  2017-01-28 15:26     ` tomas
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Berman @ 2017-01-28 14:45 UTC (permalink / raw)
  To: tomas; +Cc: help-gnu-emacs

On Sat, 28 Jan 2017 13:46:10 +0100 <tomas@tuxteam.de> wrote:

> On Sat, Jan 28, 2017 at 06:03:57PM +0530, Narendra Joshi wrote:
>> 
>> Hi,
>> 
>> I want to be able to keep some text visible in a buffer only when the
>> point is in a region. The moment the point leaves that region, I would
>> like to make the text invisible. How can I do this? I don't want to run
>> a timer which checks if the point is in the region or outside.
>
> See "Overlays" or "Text Properties" in the Emacs Lisp manual. You can set
> "point-entered" and "point-left" special properties (see "Properties with
> Special Meanings", which are hooks to be called at those events.

As of Emacs 25.1 (quoting the Info node referred to):

"These properties are obsolete; please use ‘cursor-sensor-functions’ instead."

Steve Berman



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Showing text in a buffer only when point is in a region
  2017-01-28 14:45   ` Stephen Berman
@ 2017-01-28 15:26     ` tomas
  0 siblings, 0 replies; 4+ messages in thread
From: tomas @ 2017-01-28 15:26 UTC (permalink / raw)
  To: Stephen Berman; +Cc: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, Jan 28, 2017 at 03:45:24PM +0100, Stephen Berman wrote:
> On Sat, 28 Jan 2017 13:46:10 +0100 <tomas@tuxteam.de> wrote:
> 
> > On Sat, Jan 28, 2017 at 06:03:57PM +0530, Narendra Joshi wrote:
> >> 
> >> Hi,
> >> 
> >> I want to be able to keep some text visible in a buffer [...]
> >
> > See "Overlays" or "Text Properties" in the Emacs Lisp manual. You can set
> > "point-entered" and "point-left" special properties [...]
> 
> As of Emacs 25.1 (quoting the Info node referred to):
> 
> "These properties are obsolete; please use ‘cursor-sensor-functions’ instead."

Thanks for the update

cheers
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAliMuDUACgkQBcgs9XrR2kZWjQCeKYLKlcpgpgbNS7w4718MPoks
MP4An1m8WpIUKU6Xc2q35e9BTziKBNtD
=c6F6
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-01-28 15:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-28 12:33 Showing text in a buffer only when point is in a region Narendra Joshi
2017-01-28 12:46 ` tomas
2017-01-28 14:45   ` Stephen Berman
2017-01-28 15:26     ` tomas

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.