emacs-devel
[Top][All Lists]
Advanced

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

Re: region-based face-remapping


From: Eli Zaretskii
Subject: Re: region-based face-remapping
Date: Fri, 05 Jan 2024 16:34:16 +0200

> Date: Fri, 5 Jan 2024 16:18:28 +0200
> From: Dmitry Gutov <dmitry@gutov.dev>
> Cc: jdtsmith@gmail.com, emacs-devel@gnu.org
> 
> On 05/01/2024 10:50, Eli Zaretskii wrote:
> >> Date: Fri, 5 Jan 2024 05:49:24 +0200
> >> Cc:jdtsmith@gmail.com,emacs-devel@gnu.org
> >> From: Dmitry Gutov<dmitry@gutov.dev>
> >>
> >> On 04/01/2024 09:05, Eli Zaretskii wrote:
> >>>     . one of the subroutines of face_at_buffer_position calls some Lisp
> >>>       hook
> >>>     . that Lisp hook calls code that calls face-font (or some other
> >>>       primitive which takes face-remapping-alist into account)
> >> Could you give an example of a Lisp hook which might be called from
> >> face_at_buffer_position's subroutines?
> > Why is having a specific example important?
> > 
> > Are you saying that there can never be such an example?
> 
> Yes, it would seem odd to me for face_at_buffer_position to call any hooks.

More strange hooks have been added.  For example, a face attribute
could have a function value, in which case face_at_buffer_position
will call into Lisp.

> But if it did, I would consider whether any of the hooks being called 
> would allow substituting the face with a different one (making it a 
> different way to solve the present feature request).

Any face merging looks at face-remapping-alist, so you cannot possibly
negate this.

> > With the
> > current tendency of moving stuff to Lisp and adding hooks to C code,
> > we clearly cannot convince ourselves such a hook will never happen in
> > the future, even if it doesn't exist in this particular moment in
> > time.
> 
> Even if it moved to Lisp, it won't necessarily add any hooks.

Once it's in Lisp, the probability of calling face-related functions
is much higher.



reply via email to

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