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

I installed via Melpa but not loading #3

Closed
tbrooke opened this issue Jun 9, 2015 · 22 comments
Closed

I installed via Melpa but not loading #3

tbrooke opened this issue Jun 9, 2015 · 22 comments

Comments

@tbrooke
Copy link

tbrooke commented Jun 9, 2015

This may not be the right place to ask but I get FIle mode specification error: (void-function solidity-mode)

@LefterisJP
Copy link
Collaborator

This is the right place to ask. Can you do M-x toggle-debug-on-error and then reproduce the problem and copy the call trace in the issue?

@tbrooke
Copy link
Author

tbrooke commented Jun 10, 2015

Debugger entered--Lisp error: (void-function solidity-mode)
solidity-mode()
set-auto-mode-0(solidity-mode nil)
set-auto-mode()
normal-mode(t)
after-find-file(nil t)
find-file-noselect-1(# "/eth/dapp-bin/clientreceipt/clientreceipt.sol" nil nil "/eth/dapp-bin/cl$
find-file-noselect("/Users/tmb/eth/dapp-bin/clientreceipt/clientreceipt.sol" nil nil nil)
find-file("/Users/tmb/eth/dapp-bin/clientreceipt/clientreceipt.sol")
find-file-existing("/Users/tmb/eth/dapp-bin/clientreceipt/clientreceipt.sol")

@santiagorp
Copy link

I have the same error. Some ideas? I use emacs 24.5.1

Thanks!

@bl4ck5un
Copy link

bl4ck5un commented May 2, 2016

Same problem here. Any idea?

@LefterisJP
Copy link
Collaborator

I will have a look tomorrow. Will keep you guys up to date. Installing from el-get works since I use it from there but perhaps there is an issue with Melpa.

I will fix it as soon as I can reproduce it.

@LefterisJP
Copy link
Collaborator

@bl4ck5un @santiagorp

How did you try to install the package?
Did you require the package somewhere in your emacs configuration?

(require 'solidity-mode)

@santiagorp
Copy link

santiagorp commented May 5, 2016

Actually now it seems to be working. But still I get some warnings during installation:

These are the steps I follow:

  1. Start emacs, then M-x package-list
  2. Search for solidity-mode (currently the version is 2016.04.26)
  3. Mark to install it and click install

I get the following warnings on the emacs console:

file /home/santi/.emacs.d/elpa/solidity-mode-20160426.31/solidity-mode-autoloads.el at Thu May 5 09:22:46 2016
Entering directory /home/santi/.emacs.d/elpa/solidity-mode-20160426.31/' Compiling file /home/santi/.emacs.d/elpa/solidity-mode-20160426.31/solidity-mode-pkg.el at Thu May 5 09:22:46 2016 Compiling file /home/santi/.emacs.d/elpa/solidity-mode-20160426.31/solidity-mode.el at Thu May 5 09:22:46 2016 solidity-mode.el:383:1:Warning:"/usr/bin/solc"' is a malformed function
solidity-mode.el:383:1:Warning: (error line-start (file-name) ":" line ":" column ":" " Error: " (message))' is a malformed function solidity-mode.el:386:28:Warning: reference to free variablesolidity'
solidity-mode.el:388:31:Warning: reference to free variable source-inplace' solidity-mode.el:391:12:Warning: reference to free variablesolidity-mode'
solidity-mode.el:393:17:Warning: reference to free variable
flycheck-checkers' solidity-mode.el:393:17:Warning: assignment to free variable flycheck-checkers'
solidity-mode.el:395:30:Warning: assignment to free variable
`flycheck-solidity-executable'

In end of data:
solidity-mode.el:399:1:Warning: the function `flycheck-define-checker' is not
known to be defined.

I have solidity compiler installed:

$> /usr/bin/solc --version
solc, the solidity compiler commandline interface
Version: 0.3.2-81ae2a78/Release-Linux/g++/JIT

After adding the (required 'solidity-mode) to my .emacs I see the syntax and seems to be working now. However I am not sure if the warnings during install are intended to be there.

Kind regards,

Santiago

@LefterisJP
Copy link
Collaborator

LefterisJP commented May 5, 2016

Thank you for the very detailed report @santiagorp.

I also get some of these warnings, they are harmless.

I am going to push some fixes for some of them soon.

@LefterisJP
Copy link
Collaborator

Fixed some of the warnings. Will see if I can handle the rest at some point later, but they are mainly harmless.

As for the original issue this should be fixed so I am closing this now. Please open additional issues for any further problems.

@paulperegud
Copy link

By @bmag at https://gitter.im/syl20bnr/spacemacs

I found the problem. solidity-mode does not define an autoload for its major-mode (see here), so you need to require it in user-config
see here for a proper autoloaded major-mode. I'd suggest reporting the missing autoload as a bug

@LefterisJP
Copy link
Collaborator

LefterisJP commented Oct 12, 2016

@paulperegud Thank you Paul. I will use his examples and try to provide a fix. PRs are always welcome!

The problem is I don't see this as a problem with my configuration so I would have to copy someone else's configuration to experience the issue.

@LefterisJP LefterisJP reopened this Oct 12, 2016
@LefterisJP
Copy link
Collaborator

@paulperegud I added the magic autoload comment as defined in the emacs wiki.

Can you check if your configuration is working better now?

@paulperegud
Copy link

@LefterisJP

No, it does not fix loading. I've tried adding this line myself, to no avail.

Since you've asked for my env, here it is.

$ emacs --version
GNU Emacs 24.5.1

And .spacemacs to replicate the issue:

https://gist.github.com/paulperegud/9302694f388410071ae31cecccefc7f9
Note: this is a autogenerated .spacemacs with two extra lines marked with ";; PP:" comment

Installation steps:

  1. git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d
  2. download ~/.spacemacs from gist above
  3. run emacs (when asked I choose "evil flagship" / "standard distribution" but I don't think the choice is relevant to this bug)

@paulperegud
Copy link

To force spacemacs to recompile it's configuration use "SPC f e d" to go to .spacemacs file, "SPC f s" to save it, "SPC f e R" to run configuration update process.

@bmag
Copy link

bmag commented Oct 12, 2016

@LefterisJP @paulperegud you need to wait for MELPA to catch up on the changes. It usually takes less than 5 hours.

To force spacemacs to recompile it's configuration use "SPC f e d" to go to .spacemacs file, "SPC f s" to save it, "SPC f e R" to run configuration update process.

That's not a re-compile, that's a reload. Recompile is something different, and has to do with elc files. To install the new version of the package (once it's available from MELPA), you need to either delete the solidity-mode directory inside ~/.emacs.d/elpa/, or use the "Update Packages" button in Spacemacs home buffer.

@tbrooke
Copy link
Author

tbrooke commented Oct 12, 2016

I am using Spacemacs and Emacs v 25

I was receiving this error message (see Issue 8)


Compiling file /home/victor/.emacs.d/elpa/solidity-mode-20160426.31/solidity-mode.el at Fri Apr 29 13:21:06 2016
solidity-mode.el:383:1:Warning: `"/usr/bin/solc"' is a malformed function
solidity-mode.el:383:1:Warning: `(error line-start (file-name) ":" line ":"
    column ":" " Error: " (message))' is a malformed function
solidity-mode.el:386:28:Warning: reference to free variable `solidity'
solidity-mode.el:388:31:Warning: reference to free variable `source-inplace'
solidity-mode.el:391:12:Warning: reference to free variable `solidity-mode'
solidity-mode.el:393:17:Warning: reference to free variable
    `flycheck-checkers'
solidity-mode.el:393:17:Warning: assignment to free variable
    `flycheck-checkers'
solidity-mode.el:395:30:Warning: assignment to free variable
    `flycheck-solidity-executable'

I commented out the following and it works fine, but I guess I don't have flycheck:


;;; --- interface with flycheck if existing ---
(when (require 'flycheck nil 'noerror)
  ;; add dummy source-inplace definition to avoid errors
  (defvar source-inplace)
  ;; add a solidity mode callback to set the executable of solc for flycheck
  ;; define solidity's flycheck syntax checker
  (flycheck-define-checker solidity-checker
    "A Solidity syntax checker using the solc compiler"
    :command ("/usr/bin/solc" source-inplace)
    :error-patterns
    ((error line-start (file-name) ":" line ":" column ":" " Error: " (message)))
    :modes solidity-mode
    :predicate (lambda () (eq major-mode 'solidity-mode)))
  (add-to-list 'flycheck-checkers 'solidity-checker)
  (add-hook 'solidity-mode-hook
            (lambda () (setq flycheck-solidity-executable solidity-solc-path))))

@LefterisJP
Copy link
Collaborator

@tbrooke That appears to be a different issue. Can you make a new issue and paste what you wrote there?

@LefterisJP
Copy link
Collaborator

@bmag @paulperegud Great to hear. I am not familiar with spacemacs, I ofcourse know of Melpa but use el-get myself.

If the loading issue is resolved for all of you then please tell me and I will close the issue. If not I will play with spacemacs to see what is wrong.

@tbrooke
Copy link
Author

tbrooke commented Oct 12, 2016

I did "/usr/bin/solc"' is a malformed function #8 But I guess I wasn't clear so I reposted it

@LefterisJP
Copy link
Collaborator

@paulperegud @bmag Both in normal emacs melpa and in spacemacs with the configuration you provided solidity mode seems to be auto-loaded fine right now.

Only at spacemacs there seems to be the issue @tbrooke reported though, but I will address this in the other issue.

If it's okay with you @paulperegud and you can confirm it's fine now I will close the ticket.

@paulperegud
Copy link

@LefterisJP problem is fixed, confirming!

@LefterisJP
Copy link
Collaborator

Thanks Paul!

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

6 participants