unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#47944: Unable to customize button face in `describe-package'
@ 2021-04-21 21:42 Stefan Kangas
  2021-04-22 21:03 ` Protesilaos Stavrou
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Kangas @ 2021-04-21 21:42 UTC (permalink / raw)
  To: 47944; +Cc: Protesilaos Stavrou

Severity: minor

There is currently no way to customize the button face in
`describe-package'; the face is hard-coded.  This leads to issues with
`hl-line-mode', for example:

    https://gitlab.com/protesilaos/modus-themes/-/issues/180

I'm thinking that we could just use the `custom-button' face here as it
looks similar enough, and should already exist in most popular themes.

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 64d7d56019..f2e83d3fda 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -2696,9 +2696,9 @@ package-make-button
 function is a convenience wrapper used by `describe-package-1'."
   (let ((button-text (if (display-graphic-p) text (concat "[" text "]")))
         (button-face (if (display-graphic-p)
-                         '(:box (:line-width 2 :color "dark grey")
-                                :background "light grey"
-                                :foreground "black")
+                         (progn
+                           (require 'cus-edit) ; for the custom-button face
+                           'custom-button)
                        'link)))
     (apply #'insert-text-button button-text 'face button-face 'follow-link t
            properties)))

Thoughts?





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

* bug#47944: Unable to customize button face in `describe-package'
  2021-04-21 21:42 bug#47944: Unable to customize button face in `describe-package' Stefan Kangas
@ 2021-04-22 21:03 ` Protesilaos Stavrou
  2021-04-25 11:02   ` Stefan Kangas
  0 siblings, 1 reply; 4+ messages in thread
From: Protesilaos Stavrou @ 2021-04-22 21:03 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 47944

On 2021-04-21, 23:42 +0200, Stefan Kangas <stefan@marxist.se> wrote:

> Severity: minor
>
> There is currently no way to customize the button face in
> `describe-package'; the face is hard-coded.  This leads to issues with
> `hl-line-mode', for example:
>
>     https://gitlab.com/protesilaos/modus-themes/-/issues/180
>
> I'm thinking that we could just use the `custom-button' face here as it
> looks similar enough, and should already exist in most popular themes.
>
> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
> index 64d7d56019..f2e83d3fda 100644
> --- a/lisp/emacs-lisp/package.el
> +++ b/lisp/emacs-lisp/package.el
> @@ -2696,9 +2696,9 @@ package-make-button
>  function is a convenience wrapper used by `describe-package-1'."
>    (let ((button-text (if (display-graphic-p) text (concat "[" text "]")))
>          (button-face (if (display-graphic-p)
> -                         '(:box (:line-width 2 :color "dark grey")
> -                                :background "light grey"
> -                                :foreground "black")
> +                         (progn
> +                           (require 'cus-edit) ; for the custom-button face
> +                           'custom-button)
>                         'link)))
>      (apply #'insert-text-button button-text 'face button-face 'follow-link t
>             properties)))
>
> Thoughts?

Is there any chance that cus-edit, from whence custom-button comes from,
is not loaded while describe-package is in use?

Otherwise yes, I think that face feels right and would solve the issue
you linked to.

-- 
Protesilaos Stavrou
https://protesilaos.com





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

* bug#47944: Unable to customize button face in `describe-package'
  2021-04-22 21:03 ` Protesilaos Stavrou
@ 2021-04-25 11:02   ` Stefan Kangas
  2021-04-25 18:00     ` Protesilaos Stavrou
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Kangas @ 2021-04-25 11:02 UTC (permalink / raw)
  To: Protesilaos Stavrou; +Cc: 47944

tags 47944 fixed
close 47944 28.1
thanks

Protesilaos Stavrou <info@protesilaos.com> writes:

> On 2021-04-21, 23:42 +0200, Stefan Kangas <stefan@marxist.se> wrote:
>
>> Severity: minor
>>
>> There is currently no way to customize the button face in
>> `describe-package'; the face is hard-coded.  This leads to issues with
>> `hl-line-mode', for example:
>>
>>     https://gitlab.com/protesilaos/modus-themes/-/issues/180
>>
>> I'm thinking that we could just use the `custom-button' face here as it
>> looks similar enough, and should already exist in most popular themes.
>>
>> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
>> index 64d7d56019..f2e83d3fda 100644
>> --- a/lisp/emacs-lisp/package.el
>> +++ b/lisp/emacs-lisp/package.el
>> @@ -2696,9 +2696,9 @@ package-make-button
>>  function is a convenience wrapper used by `describe-package-1'."
>>    (let ((button-text (if (display-graphic-p) text (concat "[" text "]")))
>>          (button-face (if (display-graphic-p)
>> -                         '(:box (:line-width 2 :color "dark grey")
>> -                                :background "light grey"
>> -                                :foreground "black")
>> +                         (progn
>> +                           (require 'cus-edit) ; for the custom-button face
>> +                           'custom-button)
>>                         'link)))
>>      (apply #'insert-text-button button-text 'face button-face 'follow-link t
>>             properties)))
>>
>> Thoughts?
>
> Is there any chance that cus-edit, from whence custom-button comes from,
> is not loaded while describe-package is in use?

Yes, try:

0. emacs -Q
1. M-x describe-package RET <some package from GNU ELPA> RET

> Otherwise yes, I think that face feels right and would solve the issue
> you linked to.

Thanks, I have now pushed this to master.





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

* bug#47944: Unable to customize button face in `describe-package'
  2021-04-25 11:02   ` Stefan Kangas
@ 2021-04-25 18:00     ` Protesilaos Stavrou
  0 siblings, 0 replies; 4+ messages in thread
From: Protesilaos Stavrou @ 2021-04-25 18:00 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 47944

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

> tags 47944 fixed
> close 47944 28.1
> thanks

[...]

> Thanks, I have now pushed this to master.

Thank you!

-- 
Protesilaos Stavrou
https://protesilaos.com





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

end of thread, other threads:[~2021-04-25 18:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-21 21:42 bug#47944: Unable to customize button face in `describe-package' Stefan Kangas
2021-04-22 21:03 ` Protesilaos Stavrou
2021-04-25 11:02   ` Stefan Kangas
2021-04-25 18:00     ` Protesilaos Stavrou

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).