bug#47437: 28.0.50; pulse-momentary-highlight-overlay breaks if background color is inherited

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#47437: 28.0.50; pulse-momentary-highlight-overlay breaks if background color is inherited

Ingo Lohmar-2

The bug surfaces after setting the pulse highlight face by inheriting
from other faces (no explicit background attribute), for example like
this:

(custom-set-faces
 '(pulse-highlight-start-face ((t (:inherit highlight))) 'new))

I do this as I employ a restricted set of color faces from which all
others inherit.  With the above setting, run `xref-find-definitions'
(M-.) on an elisp symbol.  This triggers
`pulse-momentary-highlight-overlay', which fails at

    (color-name-to-rgb
     (face-background 'pulse-highlight-start-face))

because the background attribute is `nil'.  Adding the "inherit"
argument works, at least in the above case:

    (color-name-to-rgb
     (face-background 'pulse-highlight-start-face nil t))

Thanks!


In GNU Emacs 28.0.50 (build 5, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
 of 2021-03-27 built on kenko
Repository revision: 5d2f319eec33fea2cb29a02210952ee590b4b21b
Repository branch: feature/pgtk
Windowing system distributor 'System Description: Debian GNU/Linux bullseye/sid

Configured using:
 'configure --with-pgtk'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY
PDUMPER PGTK PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS XIM GTK3
ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: ELisp/l

Minor modes in effect:
  TeX-PDF-mode: t
  TeX-source-correlate-mode: t
  ess-elisp-trace-mode: Toggle tracing of ess-prefixed functions.
Tracing is useful for debugging background ESS behaviour. When
enabled, all functions prefixed in `ess-' and `inferior-ess' are
instrumented with `trace-function'. Tracing is turned off by
calling `untrace-function' on these functions.
  company-skewer-mode: t
  global-git-commit-mode: t
  hi-lock-mode: t
  server-mode: t
  display-fill-column-indicator-mode: t
  subword-mode: t
  idle-highlight-mode: t
  rainbow-delimiters-mode: t
  goto-address-prog-mode: t
  shell-dirtrack-mode: t
  outline-minor-mode: t
  global-hl-todo-mode: t
  hl-todo-mode: t
  dired-async-mode: t
  pollen-global-mode: t
  xterm-mouse-mode: t
  enchive-mode: t
  selectrum-prescient-mode: t
  prescient-persist-mode: t
  amx-mode: t
  savehist-mode: t
  minibuffer-depth-indicate-mode: t
  company-posframe-mode: t
  company-statistics-mode: t
  global-company-mode: t
  company-mode: t
  beginend-global-mode: t
  beginend-prog-mode: t
  delete-selection-mode: t
  show-paren-mode: t
  electric-pair-mode: t
  which-key-mode: t
  desktop-save-mode: t
  my/window-number-mode: t
  ws-butler-global-mode: t
  ws-butler-mode: t
  global-auto-revert-mode: t
  global-so-long-mode: t
  ctrlf-mode: t
  ctrlf-local-mode: t
  selectrum-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  global-prettify-symbols-mode: t
  prettify-symbols-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t
  hs-minor-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug dired-addons notmuch-jump magit-extras
mc-addons slime-tests ob-ditaa ob-plantuml ol-bibtex bibtex-config
bibtex-clean-addons bibtex org-colview org-crypt-config org-crypt
org-habit notmuch-config notmuch notmuch-hello cus-edit wid-edit
notmuch-tree notmuch-show notmuch-print notmuch-crypto notmuch-mua
notmuch-message notmuch-draft notmuch-maildir-fcc notmuch-address
notmuch-company notmuch-parser notmuch-wash coolj notmuch-query
icalendar notmuch-tag notmuch-lib notmuch-version notmuch-compat cl
mm-view mml-smime smime dig notmuch-addons systemd gitconfig-mode
preview reftex-dcr reftex-auc reftex-toc-patch reftex-toc reftex-config
reftex reftex-loaddefs reftex-vars tex-buf font-latex latex-config
latex-addons latex-mode-expansions latex latex-flymake tex-ispell
tex-style tex-config tex texmathp tex-mode macrostep-c cmacexp macrostep
cus-start cus-load cal-move ox-org ox-md ox-odt ox-latex ox-icalendar
ox-html table ox-ascii ox-publish ox sql-config sql-addons sql pulse
apropos my-grep pcre2el rxt re-builder edebug eieio-opt speedbar ezimage
dframe shortdoc hippie-expand-config my-mode-groups hippie-expand-addons
my-flex-search hippie-exp my-completion ctrlf hl-line solar cal-dst
holidays hol-loaddefs diary-lib diary-loaddefs cal-iso org-duration
org-addons julia-mode julia-mode-latexsubs rust-addons rust-config
rust-mode make-mode cs-mode cc-langs cursor-sensor ess-r-mode
ess-r-flymake ess-r-xref ess-trns ess-r-package ess-r-completion
ess-roxy ess-r-syntax ess-rd ess-s-lang ess-help ess-mode ess-inf
ess-tracebug ess ess-utils ess-custom geiser-config geiser-mode
geiser-xref geiser-compile geiser-debug geiser-patch geiser-gambit
geiser-chibi geiser-mit geiser-chez geiser-chicken geiser-racket
geiser-guile info-look geiser-repl geiser-image geiser-company
geiser-doc geiser-menu geiser-edit geiser-completion geiser-autodoc
geiser-eval geiser-connection geiser-syntax geiser-log geiser-popup view
scheme company-skewer skewer-addons skewer-repl skewer-mode cache-table
js2-mode-expansions js2-mode simple-httpd js-config js-flymake-backends
js-patch js-mode-expansions js cc-mode-expansions cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
slime-config slime arc-mode archive-mode hyperspec rng-xsd xsd-regexp
rng-cmpct nxml-addons nxml-mode-expansions rng-nxml rng-valid rng-loc
rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns
nxml-mode nxml-outln nxml-rap html-mode-expansions sgml-mode facemenu
nxml-util nxml-enc xmltok restclient magit-bookmark bookmark magit-patch
magit-subtree magit-ediff ediff-config ediff ediff-merg ediff-mult
ediff-wind ediff-diff ediff-help ediff-init ediff-util mule-util
face-remap magit-addons magit-repos-addons tablist tablist-filter
semantic/wisent/comp semantic/wisent semantic/wisent/wisent magit-config
magit-bundle forge-config forge-list forge-commands forge-semi
forge-bitbucket buck forge-gogs gogs forge-gitea gtea forge-gitlab glab
forge-github ghub-graphql treepy gsexp ghub let-alist gnutls
forge-notify forge-revnote forge-pullreq forge-issue forge-topic
bug-reference forge-post markdown-mode edit-indirect color forge-repo
forge forge-core forge-db closql emacsql-sqlite emacsql emacsql-compiler
url-http url-auth url-gw nsm magit-submodule magit-obsolete magit-blame
magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch
magit-clone magit-remote magit-commit magit-sequence magit-notes
magit-worktree magit-tag magit-merge magit-branch magit-reset
magit-files magit-refs magit-status magit magit-repos magit-apply
magit-wip magit-log which-func magit-diff smerge-config smerge-mode diff
git-commit log-edit message-config sendmail message-addons message rmc
rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail
rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils
mailheader pcvs-util add-log magit-core magit-autorevert magit-margin
magit-transient magit-process with-editor magit-mode transient magit-git
magit-section magit-utils hi-lock cl-print my-misc-funs char-fold
two-column window-addons my-window-funs windmove server time fish-mode
go-config go-flymake-backends go-mode find-file ffap my/publish-blog
racket-mode racket-bug-report package url-handlers racket-collection tq
racket-repl-buffer-name racket-stepper racket-logger racket-profile
racket-smart-open racket-xp racket-xp-complete racket-show pos-tip
racket-imenu racket-edit racket-repl semantic/symref/grep wgrep-patch
wgrep grep-config grep semantic/symref semantic/util-modes semantic/util
semantic semantic/tag semantic/lex semantic/fw mode-local cedet
racket-eldoc racket-describe shr kinsoku puny svg dom browse-url url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf mailcap racket-visit racket-complete racket-common
racket-parens racket-indent racket-font-lock racket-ppss
racket-keywords-and-builtins ido racket-doc racket-cmd racket-util
racket-browse-url racket-custom sh-flymake-backends my-flymake-addons
sh-script smie executable rx zig-config zig-mode jka-compr conf-mode
display-fill-column-indicator subword-patch subword-mode-expansions
cap-words superword subword idle-highlight-mode rainbow-delimiters
my-outshine hideshow my-eol-fix goto-addr org-indent image-file
image-converter org-element avl-tree disp-table vc-hg vc-src vc-svn
vc-git diff-mode org-capture-config org-config my-org-contacts
org-protocol ob-scheme geiser-impl help-fns radix-tree geiser-custom
geiser-base geiser ob-dot ob-js ob-sql ob-latex ob-python python-config
python-el-fgallina-expansions python tramp-sh tramp tramp-loaddefs
trampver tramp-integration files-x tramp-compat parse-time iso8601
ls-lisp-config ls-lisp-patch ls-lisp ob-shell shell-config shell
org-attach org-id org-clock org-agenda org-refile
the-org-mode-expansions org ob ob-tangle ob-ref ob-lob ob-table ob-exp
org-macro org-footnote org-src ob-comint org-pcomplete pcomplete
org-list org-faces org-entities time-date fold-config noutline outline
org-version ob-emacs-lisp ob-core ob-eval org-table ol org-keys
org-compat org-macs org-loaddefs format-spec calendar-config cal-menu
calendar cal-loaddefs home-config my-ms-proj-mode elisp-addons
xref-addons hl-todo flymake-config help-at-pt eglot-config eglot array
jsonrpc ert pp ewoc debug backtrace flymake-proc flymake warnings
compile-config dired-subtree dired-hacks-utils dash dired-async async
dired-guess dired-aux dired-config dired-patch dired dired-loaddefs
compile-addons compile text-property-search comint-config comint
ansi-color url-util url-parse secrets dbus xml auth-source
password-cache url-vars imenu json pollen occur-config faces-config
my-solarized-colors modeline-config ui-config xt-mouse enchive-mode
my-project vc vc-dispatcher selectrum-prescient selectrum-addons
selectrum minibuf-eldef crm prescient amx s savehist mb-depth
company-posframe subr-x posframe company-statistics company-keywords
company-dabbrev-code company-dabbrev etags-addons company-etags etags
fileloop generator xref project eieio eieio-core cl-macs eieio-loaddefs
company-gtags company-template company-capf company-elisp find-func
company-config company pcase ace-link avy map tabify beginend
multiple-cursors mc-separate-operations rectangular-region-mode
mc-mark-pop mc-edit-lines mc-hide-unmatched-lines-mode mc-mark-more
mc-cycle-cursors multiple-cursors-core rect expand-region
text-mode-expansions er-basic-expansions expand-region-core
expand-region-custom delsel indent-config indent-addons sexp-addons
thingatpt paren elec-pair my-fill easy-mmode which-key advice
tab-bar-addons desktop-config my-aux-funs desktop frameset
my-window-numbers display-actions locals-patch ws-butler my-file-funs
diminish autorevert filenotify so-long my-loaddefs edmacro kmacro
cl-extra help-mode seq byte-opt gv bytecomp byte-compile cconv cl-seq
hydra ring lv cl-loaddefs cl-lib my-setup-funs info tex-site
slime-autoloads iso-transl tooltip eldoc electric uniquify ediff-hook
vc-hooks lisp-float-type mwheel term/pgtk-win pgtk-win term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode elisp-mode lisp-mode prog-mode register page
tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar
mouse jit-lock font-lock syntax font-core term/tty-colors frame
minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite charscript charprop case-table epa-hook jka-cmpr-hook help
simple abbrev obarray cl-preloaded nadvice button loaddefs faces
cus-face macroexp files window text-properties overlay sha1 md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote threads dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo move-toolbar gtk x-toolkit pgtk lcms2
multi-tty make-network-process emacs)

Memory information:
((conses 16 4011127 492190)
 (symbols 48 64096 6)
 (strings 32 342690 37556)
 (string-bytes 1 10603491)
 (vectors 16 131341)
 (vector-slots 8 2491637 239821)
 (floats 8 1428 2728)
 (intervals 56 456816 6619)
 (buffers 992 216))



Reply | Threaded
Open this post in threaded view
|

bug#47437: 28.0.50; pulse-momentary-highlight-overlay breaks if background color is inherited

Eli Zaretskii
> From: Ingo Lohmar <[hidden email]>
> Date: Sat, 27 Mar 2021 22:34:46 +0100
>
>
> The bug surfaces after setting the pulse highlight face by inheriting
> from other faces (no explicit background attribute), for example like
> this:
>
> (custom-set-faces
>  '(pulse-highlight-start-face ((t (:inherit highlight))) 'new))
>
> I do this as I employ a restricted set of color faces from which all
> others inherit.  With the above setting, run `xref-find-definitions'
> (M-.) on an elisp symbol.  This triggers
> `pulse-momentary-highlight-overlay', which fails at
>
>     (color-name-to-rgb
>      (face-background 'pulse-highlight-start-face))
>
> because the background attribute is `nil'.  Adding the "inherit"
> argument works, at least in the above case:
>
>     (color-name-to-rgb
>      (face-background 'pulse-highlight-start-face nil t))

Thanks, I made that change on master now, except that I used 'default'
instead of t, to make sure the returned value is always a color name.



Reply | Threaded
Open this post in threaded view
|

bug#47437: 28.0.50; pulse-momentary-highlight-overlay breaks if background color is inherited

Eli Zaretskii
> From: Ingo Lohmar <[hidden email]>
> Date: Sun, 28 Mar 2021 14:58:15 +0200
>
> 1) I would have suggested to use 'default' myself, if the docstring of
> `face-background' were not (IMHO) misleading: The paragraph describing
> INHERIT (wrongly) suggested to me that giving a face would also
> disregard the :inherit attribute.
>
> The same applies to the other helper functions (`face-foreground' etc).
> The docstring of `face-attribute' is clearer ("further merged") about
> the fact that inherit is still followed in the non-t case.
>
> I suggest to amend the last sentence in the inherit paragraph of all
> these docstrings, from
>
> "If INHERIT is a face or a list of faces, then it is used to try to
> resolve an unspecified ..."
>
> to
>
> "If INHERIT is a face or a list of faces, then it is used to try to
> resolve a value that is still unspecified after considering the
> `:inherit' attribute."

I made a slightly different change (on the release branch), thanks.

> 2) There are two more instances of `face-background' in
> `pulse-reset-face' in the same file, one with a 't' INHERIT argument.  I
> haven't tried to understand the details, but I strongly suspect they
> should get the 'default' argument as well.

I didn't see any places where a nil value could make a problem, so I
didn't change anything here.  If you see any problems, please report
them.