all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Temporarily overriding cursor color?
Date: Thu, 05 Feb 2015 17:36:08 +0100	[thread overview]
Message-ID: <87lhkcz56v.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <83386kfi1n.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 05 Feb 2015 18:18:44 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: David Kastrup <dak@gnu.org>
>> Date: Thu, 05 Feb 2015 14:03:10 +0100
>> 
>> 
>> (let ((cookie (face-remap-add-relative 'cursor :background "red")))
>>    (recursive-edit)
>>    (face-remap-remove-relative cookie))
>> 
>> does not appear to do anything.  Any idea why?
>
> 'cursor' is not really a face used by the Emacs display.  It's more
> like a handle to inject the 'cursor-color' parameter into a frame's
> parameter alist.  And there's no code to do that when you remap the
> 'cursor' face, so the above has no effect.
>
> By contrast, when you use (for example) set-face-background to change
> the 'cursor' face, that function eventually calls
> get_lface_attributes, which handles this face specially, see there.

But that happens per-frame rather than per-buffer.  The point of face
remapping is to be able to do buffer-local modifications.  Basically, I
was thinking of a "recording" indicator, functionally somewhat akin to
the "Def" lighter in the modeline that C-x ( puts up, just more direct.
I think in MSDOS times the equivalent of the "Ovwrt" lighter was
expressed in cursor shape.

Since the recording is done using a buffer-local keymap, keeping the
indicator buffer-local makes sense.

The question is whether my expectations here were unreasonable or
whether it would be unreasonably expensive to match them.  Of course, if
the only cursor aspect that can be face-controlled is its color, it
would seem somewhat lacklustre to invest the work for making this single
cursor-parameter controllable per-buffer.

-- 
David Kastrup



  reply	other threads:[~2015-02-05 16:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-05 13:03 Temporarily overriding cursor color? David Kastrup
2015-02-05 16:18 ` Eli Zaretskii
2015-02-05 16:36   ` David Kastrup [this message]
2015-02-05 16:58     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lhkcz56v.fsf@fencepost.gnu.org \
    --to=dak@gnu.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.