greghendershott / racket-mode

Emacs major and minor modes for Racket: edit, REPL, check-syntax, debug, profile, packages, and more.
https://www.racket-mode.com/
GNU General Public License v3.0
683 stars 93 forks source link

racket-sexp-comment-fade not working #729

Closed mateidragony closed 6 days ago

mateidragony commented 6 days ago

Package

metadata
(#s(package-desc racket-mode
         (20241116 1700)
         "Racket editing, REPL, and more."
         ((emacs
           (25 1)))
         nil nil "/home/mateidragony/.emacs.d/elpa/racket-mode-20241116.1700"
         ((:authors
           ("Greg Hendershott" . "racket-mode-author@greghendershott.com"))
          (:revdesc . "c5bee6895b2d")
          (:commit . "c5bee6895b2d028820a75356abacc19a5ed11918")
          (:url . "https://github.com/greghendershott/racket-mode"))
         nil))
package-archives
(("gnu-devel" . "https://elpa.gnu.org/devel/")
 ("melpa-stable" . "https://stable.melpa.org/packages/")
 ("gnu" . "https://elpa.gnu.org/packages/")
 ("nongnu" . "https://elpa.nongnu.org/nongnu/")
 ("melpa" . "https://melpa.org/packages/"))
racket--el-source-dir
"/home/mateidragony/.emacs.d/elpa/racket-mode-20241116.1700/"
racket--rkt-source-dir
"/home/mateidragony/.emacs.d/elpa/racket-mode-20241116.1700/racket/"

System values

emacs-version
"29.4"
major-mode
racket-mode
system-type
gnu/linux
x-gtk-use-system-tooltips
t
display-graphic-p
nil

Buffer values

after-change-functions
(jit-lock-after-change t)
before-change-functions
(t syntax-ppss-flush-cache)
completion-at-point-functions
(racket-complete-at-point)
eldoc-documentation-function
eldoc-documentation-default
eldoc-documentation-strategy
eldoc-documentation-default
eldoc-documentation-functions
nil
font-lock-defaults
((racket-font-lock-keywords-level-0 racket-font-lock-keywords-level-1 racket-font-lock-keywords-level-2 racket-font-lock-keywords-level-3)
 nil nil nil nil
 (font-lock-mark-block-function . mark-defun)
 (parse-sexp-lookup-properties . t)
 (font-lock-multiline . t)
 (font-lock-syntactic-face-function . racket-font-lock-syntactic-face-function)
 (font-lock-extend-region-functions font-lock-extend-region-wholelines font-lock-extend-region-multiline))
pre-command-hook
(tooltip-hide)
post-command-hook
(jit-lock--antiblink-post-command t)
post-self-insert-hook
(electric-pair-post-self-insert-function electric-pair-open-newline-between-pairs-psif electric-indent-post-self-insert-function blink-paren-post-self-insert-function)
xref-backend-functions
(racket-mode-xref-backend-function t)

Racket Mode values

racket--cmd-open-p
t
racket-after-run-hook
nil
racket-back-end-configurations
((:directory "/" :racket-program nil :remote-source-dir nil :restart-watch-directories nil :windows nil))
racket-before-run-hook
(racket-ansi-color-context-reset)
racket-browse-url-function
browse-url-default-browser
racket-command-timeout
10
racket-doc-index-directory
"~/.emacs.d/racket-mode/"
racket-doc-index-predicate-function
always
racket-documentation-search-location
"https://docs.racket-lang.org/search/index.html?q=%s"
racket-error-context
medium
racket-expand-hiding
standard
racket-hash-lang-token-face-alist
((constant . font-lock-constant-face)
 (error . error)
 (other . font-lock-doc-face)
 (keyword . font-lock-keyword-face)
 (hash-colon-keyword . racket-keyword-argument-face)
 (at . font-lock-doc-face))
racket-history-filter-regexp
"\\`\\s *\\'"
racket-imagemagick-props
nil
racket-images-do-not-use-svg
nil
racket-images-inline
t
racket-images-keep-last
100
racket-images-system-viewer
"display"
racket-indent-curly-as-sequence
t
racket-indent-sequence-depth
0
racket-input-prefix
"\\"
racket-input-translations
(("All" "∀")
 ("Union" "U")
 ("Intersection" "∩")
 ("test-->>E" "test-->>∃")
 ("vdash" "⊢")
 ("gg" "≫")
 ("succ" "≻")
 ("times" "×")
 ("Uparrow" "⇑")
 ("Downarrow" "⇓")
 ("Leftarrow" "⇐")
 ("Rightarrow" "⇒")
 ("leftarrow" "←")
 ("rightarrow" "→")
 ("nwarrow" "↖")
 ("nearrow" "↗")
 ("uparrow" "↑")
 ("downarrow" "↓")
 ("searrow" "↘")
 ("swarrow" "↙")
 ("leftrightarrow" "↔")
 ("updownarrow" "⇕")
 ("aleph" "א")
 ("emptyset" "∅")
 ("nabla" "∇")
 ("surd" "√")
 ("negation" "¬")
 ("infinity" "∞")
 ("prod" "∏")
 ("coprod" "∐")
 ("integrate" "∫")
 ("oint" "∮")
 ("vee" "∨")
 ("wedge" "∧")
 ("follows" "∘")
 ("setin" "∈")
 ("ni" "∋")
 ("notin" "∉")
 ("sqsubset" "⊏")
 ("sqsupset" "⊐")
 ("sqsubseteq" "⊑")
 ("sqsupseteq" "⊒")
 ("subset" "⊂")
 ("superset" "⊃")
 ("subseteq" "⊆")
 ("supseteq" "⊇")
 ("approx" "≈")
 ("cong" "≌")
 ("neq" "≠")
 ("sqcap" "⊓")
 ("sqcup" "⊔")
 ("models" "⊧")
 ("alpha" "α")
 ("Alpha" "Α")
 ("beta" "β")
 ("Beta" "Β")
 ("gamma" "γ")
 ("Gamma" "Γ")
 ("delta" "δ")
 ("Delta" "Δ")
 ("epsilon" "ε")
 ("Epsilon" "Ε")
 ("zeta" "ζ")
 ("Zeta" "Ζ")
 ("eta" "η")
 ("Eta" "Η")
 ("theta" "θ")
 ("Theta" "Θ")
 ("iota" "ι")
 ("Iota" "Ι")
 ("kappa" "κ")
 ("Kappa" "Κ")
 ("lambda" "λ")
 ("Lambda" "Λ")
 ("lamda" "λ")
 ("Lamda" "Λ")
 ("mu" "μ")
 ("Mu" "Μ")
 ("nu" "ν")
 ("Nu" "Ν")
 ("xi" "ξ")
 ("Xi" "Ξ")
 ("omicron" "ο")
 ("Omicron" "Ο")
 ("pi" "π")
 ("Pi" "Π")
 ("rho" "ρ")
 ("Rho" "Ρ")
 ("sigma" "σ")
 ("Sigma" "Σ")
 ("tau" "τ")
 ("Tau" "Τ")
 ("upsilon" "υ")
 ("Upsilon" "Υ")
 ("phi" "φ")
 ("Phi" "Φ")
 ("chi" "χ")
 ("Chi" "Χ")
 ("psi" "ψ")
 ("Psi" "Ψ")
 ("omega" "ω")
 ("Omega" "Ω")
 ("digamma" "ϝ")
 ("Digamma" "Ϝ")
 ("san" "ϻ")
 ("San" "Ϻ")
 ("qoppa" "ϙ")
 ("Qoppa" "Ϙ")
 ("sampi" "ϡ")
 ("Sampi" "Ϡ")
 ("stigma" "ϛ")
 ("Stigma" "Ϛ")
 ("heta" "ͱ")
 ("Heta" "Ͱ")
 ("sho" "ϸ")
 ("Sho" "Ϸ")
 ("|A|" "𝔸")
 ("|B|" "𝔹")
 ("|C|" "ℂ")
 ("|D|" "𝔻")
 ("|E|" "𝔼")
 ("|F|" "𝔽")
 ("|G|" "𝔾")
 ("|H|" "ℍ")
 ("|I|" "𝕀")
 ("|J|" "𝕁")
 ("|K|" "𝕂")
 ("|L|" "𝕃")
 ("|M|" "𝕄")
 ("|N|" "ℕ")
 ("|O|" "𝕆")
 ("|P|" "ℙ")
 ("|Q|" "ℚ")
 ("|R|" "ℝ")
 ("|S|" "𝕊")
 ("|T|" "𝕋")
 ("|U|" "𝕌")
 ("|V|" "𝕍")
 ("|W|" "𝕎")
 ("|X|" "𝕏")
 ("|Y|" "𝕐")
 ("|Z|" "ℤ")
 ("|gamma|" "ℽ")
 ("|Gamma|" "ℾ")
 ("|pi|" "ℼ")
 ("|Pi|" "ℿ")
 ("forall" "∀")
 ("exists" "∃")
 ("_0" "₀")
 ("_1" "₁")
 ("_2" "₂")
 ("_3" "₃")
 ("_4" "₄")
 ("_5" "₅")
 ("_6" "₆")
 ("_7" "₇")
 ("_8" "₈")
 ("_9" "₉")
 ("^0" "⁰")
 ("^1" "¹")
 ("^2" "²")
 ("^3" "³")
 ("^4" "⁴")
 ("^5" "⁵")
 ("^6" "⁶")
 ("^7" "⁷")
 ("^8" "⁸")
 ("^9" "⁹"))
racket-logger-config
((cm-accomplice . warning)
 (GC . info)
 (module-prefetch . warning)
 (optimizer . info)
 (racket/contract . error)
 (racket-mode-debugger . info)
 (sequence-specialization . info)
 (* . fatal))
racket-memory-limit
2048
racket-mode-hook
nil
racket-module-forms
"\\s(\\(?:module[*+]?\\|library\\)"
racket-pretty-lambda
nil
racket-pretty-print
t
racket-program
"racket"
racket-repl-buffer-name-function
nil
racket-repl-command-file
"/home/mateidragony/.emacs.d/racket-mode/repl.rkt"
racket-repl-history-directory
"~/.emacs.d/racket-mode/"
racket-repl-mode-hook
nil
racket-sexp-comment-fade
0.5
racket-shell-or-terminal-function
racket-shell
racket-show-functions
(racket-show-pseudo-tooltip)
racket-smart-open-bracket-enable
nil
racket-submodules-to-run
((test)
 (main))
racket-use-repl-submit-predicate
nil
racket-xp-add-binding-faces
nil
racket-xp-after-change-refresh-delay
1
racket-xp-eldoc-level
summary
racket-xp-highlight-unused-regexp
"^[^_]"
racket-xp-mode-lighter
(:eval
 (racket--xp-mode-lighter))

Minor modes

enabled
((auto-composition-mode)
 (auto-compression-mode)
 (auto-encryption-mode)
 (blink-cursor-mode)
 (display-line-numbers-mode)
 (electric-indent-mode)
 (electric-pair-mode)
 (file-name-shadow-mode)
 (font-lock-mode)
 (global-display-line-numbers-mode)
 (global-eldoc-mode)
 (global-font-lock-mode)
 (line-number-mode)
 (mouse-wheel-mode)
 (override-global-mode)
 (semantic-minor-modes-format)
 (shell-dirtrack-mode)
 (show-paren-mode)
 (tool-bar-mode)
 (tooltip-mode)
 (transient-mark-mode))
Disabled minor modes
disabled
((abbrev-mode)
 (archive-subfile-mode)
 (auto-fill-function)
 (auto-fill-mode)
 (auto-save-mode)
 (auto-save-visited-mode)
 (buffer-face-mode)
 (buffer-read-only)
 (button-mode)
 (cl-old-struct-compat-mode)
 (column-number-mode)
 (comint-fontify-input-mode)
 (company-mode)
 (company-search-mode)
 (compilation-minor-mode)
 (compilation-shell-minor-mode)
 (completion-in-region-mode)
 (context-menu-mode)
 (cursor-face-highlight-mode)
 (dash-fontify-mode)
 (defining-kbd-macro)
 (dired-hide-details-mode)
 (eldoc-mode)
 (electric-layout-mode)
 (electric-quote-mode)
 (global-company-mode)
 (global-dash-fontify-mode)
 (global-prettify-symbols-mode)
 (global-semantic-highlight-edits-mode)
 (global-semantic-highlight-func-mode)
 (global-semantic-show-parser-state-mode)
 (global-semantic-show-unmatched-syntax-mode)
 (global-semantic-stickyfunc-mode)
 (global-visual-line-mode)
 (header-line-indent-mode)
 (horizontal-scroll-bar-mode)
 (hs-minor-mode)
 (indent-tabs-mode)
 (irony-mode)
 (isearch-fold-quotes-mode)
 (isearch-mode)
 (jit-lock-debug-mode)
 (lock-file-mode)
 (lost-selection-mode)
 (mail-abbrevs-mode)
 (menu-bar-mode)
 (mml-mode)
 (next-error-follow-minor-mode)
 (overwrite-mode)
 (paragraph-indent-minor-mode)
 (prettify-symbols-mode)
 (racket-input-mode)
 (racket-smart-open-bracket-mode)
 (racket-xp-mode)
 (rainbow-delimiters-mode)
 (read-extended-command-mode)
 (semantic-highlight-edits-mode)
 (semantic-highlight-func-mode)
 (semantic-mode)
 (semantic-show-parser-state-mode)
 (semantic-show-unmatched-syntax-mode)
 (semantic-stickyfunc-mode)
 (sh-electric-here-document-mode)
 (shell-highlight-undef-mode)
 (size-indication-mode)
 (tab-bar-history-mode)
 (tab-bar-mode)
 (tar-subfile-mode)
 (temp-buffer-resize-mode)
 (text-scale-mode)
 (treesit-explore-mode)
 (treesit-inspect-mode)
 (undelete-frame-mode)
 (url-handler-mode)
 (use-hard-newlines)
 (view-mode)
 (visible-mode)
 (visual-line-mode)
 (window-divider-mode)
 (xref-etags-mode))

Steps to reproduce:

Type this program

#; (+ 1 2)

The sexp does not fade due to the comment like it used to.

image

mateidragony commented 6 days ago

For those interested, fading wasn't working due to my emacs background being clear

greghendershott commented 5 days ago

Oh that's an interesting case I hadn't considered.

If you M-x describe-face and enter default, what are the face properties?

If Background is something like nil, I wonder if an effective fallback plan would be to blend the colors with black, instead?

greghendershott commented 5 days ago

I tried to figure out a bit more, on my own.

I notice starting in Emacs 29 there's a new alpha-background frame parameter.

When I M-x eval and enter (set-frame-parameter nil 'alpha-background 0), sexp comment fading still works. (Maybe because my theme still has a dark background for the default font, I'm not sure.)

So I'd be grateful if you have time to supply more details so I can reproduce.

mateidragony commented 1 day ago

Yeah, so my theme just doesn't set default background, so its value is unspecified-bg. The alpha-background thing doesn't seem to do anything to make my background clear though....

mateidragony commented 1 day ago

I think a quick fix would just be to have a fallback value for fading like you said, which is what I implemented for my custom config

greghendershott commented 1 hour ago

Maybe I'm being dense, but I can't figure out how to set the default face's background property to "unspecified".

No matter what I tried:

Regardless (face-attribute 'default :background) continues to return the color #002b36 originally from my theme.

So unfortunately I don't know how to reproduce this.

As a result, although I could add some fallback value, I wouldn't know if it actually fixes the problem you saw, and doesn't cause new problems. :disappointed: