alphapapa / alphapapa/prism.el

prism-save-colors called after prism-randomize-colors reverts to the default pulled from prism-set-colors

オープン
#17 コメント 1 件 リアクション 0 件 担当者 1 名 @alphapapa が担当を希望しています GitHub で見る
bug
主要言語
Emacs Lisp
スター
334
フォーク
5
PR マージ指標
30日以内にマージされた PR はありません

説明

I'm a novice with emacs and lisp, so pardon me in advance for my ignorance. As mentioned in the readme, I called `prism-randomize-colors` and then `prism-save-colors`, but instead of saving the current color scheme, it resets the color scheme to the result of calling `prism-set-colors`.

I'm trying to figure out why this is happening, and it appears that in `prism-set-colors`,
```
...
(set-vars prism-faces (faces colors)
prism-faces-strings (faces colors "strings" strings-fn)
prism-faces-comments (faces colors "comments" comments-fn)
prism-faces-parens (faces colors "parens" parens-fn)))
(when (and save (not local))
;; Save arguments for later saving as customized variables,
;; including the unmodified (but shuffled) colors.
(setf prism-colors colors
prism-desaturations desaturations
prism-lightens lightens
prism-num-faces num
prism-comments-fn comments-fn
prism-strings-fn strings-fn
prism-parens-fn parens-fn)
(prism-save-colors)))))
```
that when the `save` parameter isn't true, `prism-set-colors` doesn't set `prism-color`, `prism-desaturations`, etc., but, `prism-save-colors` assumes those variables are set:
```
(cl-letf (((symbol-function 'custom-save-all)
(symbol-function 'ignore)))
;; Avoid saving the file for each variable, which is very slow.
;; Save it once at the end.
(dolist (var (list 'prism-desaturations 'prism-lightens 'prism-num-faces
'prism-comments-fn 'prism-strings-fn))
(customize-save-variable var (symbol-value var))))
(customize-save-variable 'prism-colors prism-colors))
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。