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

Advice rainbow-turn-on causes an error #110

Closed
wujiang opened this issue May 14, 2013 · 6 comments
Closed

Advice rainbow-turn-on causes an error #110

wujiang opened this issue May 14, 2013 · 6 comments

Comments

@wujiang
Copy link

wujiang commented May 14, 2013

  • Issue
    This advice breaks the zenburn package.
(defadvice rainbow-turn-on (after zenburn activate)
    ...)

The error message is

ad-Advice-rainbow-turn-on: Wrong type argument: stringp, nil
  • Version
    • emacs 24.3.1 and 24.3.50.1
    • zenburn 20130513.1724
    • rainbow 0.8

Running emacs --debug-init did not give more information about the error.

("emacs")
Loading 00debian-vars...done
Loading /etc/emacs-snapshot/site-start.d/00emacs-snapshot-common.el (source)...done
Loading /etc/emacs/site-start.d/50autoconf.el (source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Skipping dictionaries-common setup for emacs-snapshot
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done
Loading /etc/emacs/site-start.d/50emacs-calfw.el (source)...done
Loading /etc/emacs/site-start.d/50emacs-goodies-el.el (source)...done
Loading /etc/emacs/site-start.d/50emacs-intl-fonts.el (source)...done
Loading /etc/emacs/site-start.d/50gnu-smalltalk-el.el (source)...
Error while loading 50gnu-smalltalk-el: Symbol's value as variable is void: inhibit-first-line-modes-regexps
Loading /etc/emacs/site-start.d/50golang-mode.el (source)...done
Loading /etc/emacs/site-start.d/50latex-cjk-common.el (source)...
Loading cjk-enc...done
Loading /etc/emacs/site-start.d/50latex-cjk-common.el (source)...done
Loading /etc/emacs/site-start.d/50latex-cjk-thai.el (source)...done
Loading /etc/emacs/site-start.d/50pylint.el (source)...
Loading pylint...done
Loading /etc/emacs/site-start.d/50pylint.el (source)...done
Loading /etc/emacs/site-start.d/50thailatex.el (source)...done
Prelude is powering up... Be patient, Master wjiang!
Source file `/home/wjiang/.emacs.d/core/prelude-packages.el' newer than byte-compiled file
Loading /home/wjiang/.emacs.d/elpa/zenburn-theme-20130513.1724/zenburn-theme.el (source)...done
Loading /home/wjiang/.emacs.d/savefile/recentf...done
Cleaning up the recentf list...done (0 removed)
[yas] Prepared just-in-time loading for /home/wjiang/.emacs.d/elpa/yasnippet-20130505.2115/snippets
[yas] Prepared just-in-time loading for ~/.emacs.d/snippets
[yas] Prepared just-in-time loading for /home/wjiang/.emacs.d/snippets
[yas] Prepared just-in-time loading for /home/wjiang/.emacs.d/personal/snippets
[yas] Reloaded everything (snippets will load just-in-time)....
Loading /home/wjiang/.emacs.d/prelude-modules.el (source)...
SLIME is not installed. Use Quicklisp to install it.
Loading /home/wjiang/.emacs.d/prelude-modules.el (source)...done
Loading /home/wjiang/.emacs.d/personal/custom.el (source)...done
Prelude is ready to do thy bidding, Master wjiang!
[yas] Cyclic parenthood: mode text-mode has already seen as a parent of mode emacs-lisp-mode
[yas] Loading for `emacs-lisp-mode', just-in-time: (yas--load-directory-1 /home/wjiang/.emacs.d/elpa/yasnippet-20130505.2115/snippets/emacs-lisp-mode (quote emacs-lisp-mode) (quote (text-mode)))!
[yas] Loading compiled snippets from /home/wjiang/.emacs.d/elpa/yasnippet-20130505.2115/snippets/emacs-lisp-mode
[yas] Loading for `text-mode', just-in-time: (yas--load-directory-1 /home/wjiang/.emacs.d/elpa/yasnippet-20130505.2115/snippets/text-mode (quote text-mode) (quote nil))!
[yas] Loading compiled snippets from /home/wjiang/.emacs.d/elpa/yasnippet-20130505.2115/snippets/text-mode
Starting new Ispell process [aspell::default] ...
ad-Advice-rainbow-turn-on: Wrong type argument: stringp, nil
@bbatsov
Copy link
Owner

bbatsov commented May 16, 2013

@tarsius I'll disable this, since I got a ton of complaints.

@tarsius
Copy link
Contributor

tarsius commented May 16, 2013

@bbatsov were there more complaints I cannot see? The first issue we fixed and here I still cannot see anything with the code I added (not saying there ain't nothing wrong, just can't see it).

@wujiang could you try replacing activate in the defadvice form with disable. If the error is caused by the advice then this should make the errror go away (but of course that isn't a solution, just an attempt to figure out what is going on).

I still cannot reproduce this. I intentionally added an error to the rainbow-turn-on advice, which causes an error message but no error to be raised. Edit: which I think is the same you are seeing, right?

Edit: I will look for a way to enable debugging during advices.

@wujiang
Copy link
Author

wujiang commented May 16, 2013

@tarsius For myself, I just deleted it since I'm not using rainbow-mode which is very slow for large files.

@bbatsov
Copy link
Owner

bbatsov commented May 16, 2013

@tarsius Have at look at Prelude's tracker - bbatsov/prelude#318 bbatsov/prelude#319 (Prelude uses Zenburn by default, so generally bugs are reported there instead of here)

@bbatsov
Copy link
Owner

bbatsov commented Jun 2, 2013

@tarsius Any progress with this?

@tarsius
Copy link
Contributor

tarsius commented Jun 9, 2013

Sorry no. I intend to have another look soon.

@bbatsov bbatsov closed this as completed Oct 18, 2014
bbatsov pushed a commit that referenced this issue Aug 8, 2019
I originally implemented these advices in #106.  They got commented
out in 27cee3d in response to #110 and similar reports in prelude's
issue tracker.

I just implemented the same thing again, only to find the commented
advices once I was done... five years later... it seem I would very
much like this.

So I had a look at the reports and it seems pretty obvious what the
issue was: just because the major-mode is `emacs-lisp-mode', that
does not mean that the buffer is visiting a file.  And the fix is
to check whether the buffer is visiting a file before trying to do
something with the `buffer-file-name'.

Besides reverting the commenting and fixing the bug, this commit
also does the following:

- Use `zenburn-default-colors-alist' because that variable has since
  been renamed.

- Add out keywords at the end because otherwise the "blue" in
  "zenburn-blue" for example would have "blue" as the background color
  instead of "zenburn-blue".

- Extend the doc-string of `zenburn-add-font-lock-keywords' to make
  users aware of a complication.
archit-rastogi pushed a commit to archit-rastogi/zenburn-emacs that referenced this issue May 24, 2020
I originally implemented these advices in bbatsov#106.  They got commented
out in 27cee3d in response to bbatsov#110 and similar reports in prelude's
issue tracker.

I just implemented the same thing again, only to find the commented
advices once I was done... five years later... it seem I would very
much like this.

So I had a look at the reports and it seems pretty obvious what the
issue was: just because the major-mode is `emacs-lisp-mode', that
does not mean that the buffer is visiting a file.  And the fix is
to check whether the buffer is visiting a file before trying to do
something with the `buffer-file-name'.

Besides reverting the commenting and fixing the bug, this commit
also does the following:

- Use `zenburn-default-colors-alist' because that variable has since
  been renamed.

- Add out keywords at the end because otherwise the "blue" in
  "zenburn-blue" for example would have "blue" as the background color
  instead of "zenburn-blue".

- Extend the doc-string of `zenburn-add-font-lock-keywords' to make
  users aware of a complication.
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

No branches or pull requests

3 participants