Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable scaling for nyan-mode #49

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tusooa
Copy link

@tusooa tusooa commented Oct 2, 2020

This solves #37 and #48.

Under Emacs 27:

  • -animation -wavy image
  • -animation +wavy image
  • +animation -wavy image
  • +animation +wavy image

This allows nyan-mode to be displayed properly in Emacs 27.
It also enables user to make their nyan bar larger, which
is useful for HiDPI screens.
Scaling the rainbow xpm will result in the individual
rainbow segments being too wide. We use svg for
rainbow to make it higher, while maintaining the width
at 8px.
@bhankas
Copy link

bhankas commented Dec 14, 2021

After applying this patch I get below error:

Debugger entered--Lisp error: (void-function nyan-wavy-rainbow-ascent)
  nyan-wavy-rainbow-ascent(0 t)
  nyan-create-rainbow-frame-image(t (svg ((width . 8) (height . 15.0) (version . "1.1") (xmlns . "http://www.w3.org/2000/svg") (xmlns:xlink . "http://www.w3.org/1999/xlink") (stroke-width . 8)) (defs nil (linearGradient ((id . "gradient1") (x1 . 0) (x2 . 0) (y1 . 0) (y2 . 1)) (stop ((offset . "0.0%") (stop-color . "#522244"))) (stop ((offset . "7.142857142857142%") (stop-color . "#BF1119"))) (stop ((offset . "14.285714285714285%") (stop-color . "#F52A02"))) (stop ((offset . "21.428571428571427%") (stop-color . "#FC7800"))) (stop ((offset . "28.57142857142857%") (stop-color . "#FBA500"))) (stop ((offset . "35.714285714285715%") (stop-color . "#F0D300"))) (stop ((offset . "42.857142857142854%") (stop-color . "#B4BF00"))) (stop ((offset . "50.0%") (stop-color . "#4E9802"))) (stop ((offset . "57.14285714285714%") (stop-color . "#2CCB13"))) (stop ((offset . "64.28571428571429%") (stop-color . "#20D15C"))) (stop ((offset . "71.42857142857143%") (stop-color . "#0EA7CB"))) (stop ((offset . "78.57142857142857%") (stop-color . "#1E80F7"))) (stop ((offset . "85.71428571428571%") (stop-color . "#5247F7"))) (stop ((offset . "92.85714285714286%") (stop-color . "#5536D9"))) (stop ((offset . "100.0%") (stop-color . "#263498"))))) (rect ((width . 8) (height . 15.0) (x . 0) (y . 0) (x1 . 0) (x2 . 0) (y1 . 0) (y2 . 1) (fill . "url(#gradient1)") (stroke-width . 8)))) 0)
  nyan-create-rainbow-images(t)
  (defvar nyan-rainbow-animating-images (nyan-create-rainbow-images t))
  (nyan-mode)

For reference, I am using Emacs master (29.0.50, updated 13th Dec 2021). Can you please suggest what could be done to fix this? I am not well versed in elisp.

@tusooa
Copy link
Author

tusooa commented Dec 14, 2021

After applying this patch I get below error:

Debugger entered--Lisp error: (void-function nyan-wavy-rainbow-ascent)
  nyan-wavy-rainbow-ascent(0 t)
  nyan-create-rainbow-frame-image(t (svg ((width . 8) (height . 15.0) (version . "1.1") (xmlns . "http://www.w3.org/2000/svg") (xmlns:xlink . "http://www.w3.org/1999/xlink") (stroke-width . 8)) (defs nil (linearGradient ((id . "gradient1") (x1 . 0) (x2 . 0) (y1 . 0) (y2 . 1)) (stop ((offset . "0.0%") (stop-color . "#522244"))) (stop ((offset . "7.142857142857142%") (stop-color . "#BF1119"))) (stop ((offset . "14.285714285714285%") (stop-color . "#F52A02"))) (stop ((offset . "21.428571428571427%") (stop-color . "#FC7800"))) (stop ((offset . "28.57142857142857%") (stop-color . "#FBA500"))) (stop ((offset . "35.714285714285715%") (stop-color . "#F0D300"))) (stop ((offset . "42.857142857142854%") (stop-color . "#B4BF00"))) (stop ((offset . "50.0%") (stop-color . "#4E9802"))) (stop ((offset . "57.14285714285714%") (stop-color . "#2CCB13"))) (stop ((offset . "64.28571428571429%") (stop-color . "#20D15C"))) (stop ((offset . "71.42857142857143%") (stop-color . "#0EA7CB"))) (stop ((offset . "78.57142857142857%") (stop-color . "#1E80F7"))) (stop ((offset . "85.71428571428571%") (stop-color . "#5247F7"))) (stop ((offset . "92.85714285714286%") (stop-color . "#5536D9"))) (stop ((offset . "100.0%") (stop-color . "#263498"))))) (rect ((width . 8) (height . 15.0) (x . 0) (y . 0) (x1 . 0) (x2 . 0) (y1 . 0) (y2 . 1) (fill . "url(#gradient1)") (stroke-width . 8)))) 0)
  nyan-create-rainbow-images(t)
  (defvar nyan-rainbow-animating-images (nyan-create-rainbow-images t))
  (nyan-mode)

For reference, I am using Emacs master (29.0.50, updated 13th Dec 2021). Can you please suggest what could be done to fix this? I am not well versed in elisp.

Maybe move (defun nyan-wavy-rainbow-ascent ...) block to before the function nyan-create-rainbow-frame-image.

@tusooa
Copy link
Author

tusooa commented Dec 14, 2021

Actually, I suspect this patch makes Emacs 27 freeze after opening for several days. I am currently actively using it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants