unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#47810: 28.0.50; pulse no longer accepts a face argument
@ 2021-04-15 19:35 Protesilaos Stavrou
  2021-04-16  8:32 ` Gregory Heytings
  0 siblings, 1 reply; 5+ messages in thread
From: Protesilaos Stavrou @ 2021-04-15 19:35 UTC (permalink / raw)
  To: 47810

Dear maintainers,

I would expect the following two expressions to produce pulse effects
that differ in colour (tried with emacs -Q):

    (pulse-momentary-highlight-region (point-at-bol) (point-at-eol) 'highlight)
    (pulse-momentary-highlight-region (point-at-bol) (point-at-eol) 'region)

Instead they use the background of pulse-highlight-start-face.  This
test confirms as much:

    (set-face-background 'pulse-highlight-start-face "red")
    (pulse-momentary-highlight-region (point-at-bol) (point-at-eol) 'highlight)
    
    (set-face-background 'pulse-highlight-start-face "blue")
    (pulse-momentary-highlight-region (point-at-bol) (point-at-eol) 'region)

The following diff addresses the problem with the FACE argument, but
introduces a noticeable delay to the pulse effect:

     lisp/cedet/pulse.el | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/lisp/cedet/pulse.el b/lisp/cedet/pulse.el
    index 1e4506713a..e4733ca007 100644
    --- a/lisp/cedet/pulse.el
    +++ b/lisp/cedet/pulse.el
    @@ -147,7 +147,7 @@ (defun pulse-momentary-highlight-overlay (o &optional face)
          (add-hook 'pre-command-hook
                #'pulse-momentary-unhighlight))
           ;; Pulse it.
    -      (overlay-put o 'face 'pulse-highlight-face)
    +      (overlay-put o 'face (or face 'pulse-highlight-start-face))
           ;; The pulse function puts FACE onto 'pulse-highlight-face.
           ;; Thus above we put our face on the overlay, but pulse
           ;; with a reference face needed for the color.

I am not sure what may be causing that delay.

Thank you for your attention!

-- 
Protesilaos Stavrou
protesilaos.com





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

* bug#47810: 28.0.50; pulse no longer accepts a face argument
  2021-04-15 19:35 bug#47810: 28.0.50; pulse no longer accepts a face argument Protesilaos Stavrou
@ 2021-04-16  8:32 ` Gregory Heytings
  2021-04-16 11:09   ` Protesilaos Stavrou
  0 siblings, 1 reply; 5+ messages in thread
From: Gregory Heytings @ 2021-04-16  8:32 UTC (permalink / raw)
  To: Protesilaos Stavrou; +Cc: 47810

[-- Attachment #1: Type: text/plain, Size: 377 bytes --]


>
> I would expect the following two expressions to produce pulse effects 
> that differ in colour (tried with emacs -Q):
>
>    (pulse-momentary-highlight-region (point-at-bol) (point-at-eol) 'highlight)
>    (pulse-momentary-highlight-region (point-at-bol) (point-at-eol) 'region)
>
> Instead they use the background of pulse-highlight-start-face.
>

Indeed; patch attached.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-diff; name=Use-correct-face-when-pulsing-Bug-47810.patch, Size: 1194 bytes --]

From b85bb170b2d4d052696e29c4fa429437b2b95c0c Mon Sep 17 00:00:00 2001
From: Gregory Heytings <gregory@heytings.org>
Date: Fri, 16 Apr 2021 08:23:04 +0000
Subject: [PATCH] Use correct face when pulsing (Bug#47810)

* lisp/cedet/pulse.el (pulse-momentary-highlight-overlay): Use
pulse-highlight-face, not pulse-highlight-start-face.
---
 lisp/cedet/pulse.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lisp/cedet/pulse.el b/lisp/cedet/pulse.el
index 1e4506713a..62b2072e18 100644
--- a/lisp/cedet/pulse.el
+++ b/lisp/cedet/pulse.el
@@ -153,8 +153,7 @@ pulse-momentary-highlight-overlay
       ;; with a reference face needed for the color.
       (pulse-reset-face face)
       (let* ((start (color-name-to-rgb
-                     (face-background 'pulse-highlight-start-face
-                                      nil 'default)))
+                     (face-background 'pulse-highlight-face nil 'default)))
              (stop (color-name-to-rgb (face-background 'default)))
              (colors (mapcar (apply-partially 'apply 'color-rgb-to-hex)
                              (color-gradient start stop pulse-iterations))))
-- 
2.30.2


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

* bug#47810: 28.0.50; pulse no longer accepts a face argument
  2021-04-16  8:32 ` Gregory Heytings
@ 2021-04-16 11:09   ` Protesilaos Stavrou
  2021-04-21  0:02     ` Stefan Kangas
  0 siblings, 1 reply; 5+ messages in thread
From: Protesilaos Stavrou @ 2021-04-16 11:09 UTC (permalink / raw)
  To: Gregory Heytings; +Cc: 47810

On 2021-04-16, 08:32 +0000, Gregory Heytings <gregory@heytings.org> wrote:

>>
>> I would expect the following two expressions to produce pulse effects
>> that differ in colour (tried with emacs -Q):
>>
>>    (pulse-momentary-highlight-region (point-at-bol) (point-at-eol) 'highlight)
>>    (pulse-momentary-highlight-region (point-at-bol) (point-at-eol) 'region)
>>
>> Instead they use the background of pulse-highlight-start-face.
>>
>
> Indeed; patch attached.

Thank you!  I can confirm that this works.

-- 
Protesilaos Stavrou
protesilaos.com





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

* bug#47810: 28.0.50; pulse no longer accepts a face argument
  2021-04-16 11:09   ` Protesilaos Stavrou
@ 2021-04-21  0:02     ` Stefan Kangas
  2021-05-04  4:33       ` Protesilaos Stavrou
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Kangas @ 2021-04-21  0:02 UTC (permalink / raw)
  To: Protesilaos Stavrou; +Cc: 47810, Gregory Heytings

Protesilaos Stavrou <info@protesilaos.com> writes:

> On 2021-04-16, 08:32 +0000, Gregory Heytings <gregory@heytings.org> wrote:
>
>>>
>>> I would expect the following two expressions to produce pulse effects
>>> that differ in colour (tried with emacs -Q):
>>>
>>>    (pulse-momentary-highlight-region (point-at-bol) (point-at-eol) 'highlight)
>>>    (pulse-momentary-highlight-region (point-at-bol) (point-at-eol) 'region)
>>>
>>> Instead they use the background of pulse-highlight-start-face.
>>>
>>
>> Indeed; patch attached.
>
> Thank you!  I can confirm that this works.

I guess we are still waiting for Gregory's copyright papers to come
through before this can be applied?





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

* bug#47810: 28.0.50; pulse no longer accepts a face argument
  2021-04-21  0:02     ` Stefan Kangas
@ 2021-05-04  4:33       ` Protesilaos Stavrou
  0 siblings, 0 replies; 5+ messages in thread
From: Protesilaos Stavrou @ 2021-05-04  4:33 UTC (permalink / raw)
  To: Gregory Heytings; +Cc: 47810, Stefan Kangas

On 2021-04-20, 19:02 -0500, Stefan Kangas <stefan@marxist.se> wrote:

> Protesilaos Stavrou <info@protesilaos.com> writes:
>
>> On 2021-04-16, 08:32 +0000, Gregory Heytings <gregory@heytings.org> wrote:
>>
>>>>
>>>> I would expect the following two expressions to produce pulse effects
>>>> that differ in colour (tried with emacs -Q):
>>>>
>>>>    (pulse-momentary-highlight-region (point-at-bol) (point-at-eol) 'highlight)
>>>>    (pulse-momentary-highlight-region (point-at-bol) (point-at-eol) 'region)
>>>>
>>>> Instead they use the background of pulse-highlight-start-face.
>>>>
>>>
>>> Indeed; patch attached.
>>
>> Thank you!  I can confirm that this works.
>
> I guess we are still waiting for Gregory's copyright papers to come
> through before this can be applied?

Hello Gregory!

Has your copyright assignment process been finalised?  Maybe Stefan can
help install your patches.  There is this bug report as well as #47960.

All the best,
Protesilaos or "Prot"

-- 
Protesilaos Stavrou
https://protesilaos.com





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

end of thread, other threads:[~2021-05-04  4:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-15 19:35 bug#47810: 28.0.50; pulse no longer accepts a face argument Protesilaos Stavrou
2021-04-16  8:32 ` Gregory Heytings
2021-04-16 11:09   ` Protesilaos Stavrou
2021-04-21  0:02     ` Stefan Kangas
2021-05-04  4:33       ` Protesilaos Stavrou

unofficial mirror of bug-gnu-emacs@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/emacs-bugs/0 emacs-bugs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 emacs-bugs emacs-bugs/ https://yhetil.org/emacs-bugs \
		bug-gnu-emacs@gnu.org
	public-inbox-index emacs-bugs

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.bugs
	nntp://news.gmane.io/gmane.emacs.bugs


code repositories for project(s) associated with this inbox:

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

AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git