GithubHelp home page GithubHelp logo

Comments (22)

bmag avatar bmag commented on August 16, 2024 1

@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.

from emacs-solidity.

LefterisJP avatar LefterisJP commented on August 16, 2024

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?

from emacs-solidity.

tbrooke avatar tbrooke commented on August 16, 2024

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")

from emacs-solidity.

santiagorp avatar santiagorp commented on August 16, 2024

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

Thanks!

from emacs-solidity.

bl4ck5un avatar bl4ck5un commented on August 16, 2024

Same problem here. Any idea?

from emacs-solidity.

LefterisJP avatar LefterisJP commented on August 16, 2024

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.

from emacs-solidity.

LefterisJP avatar LefterisJP commented on August 16, 2024

@bl4ck5un @santiagorp

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

(require 'solidity-mode)

from emacs-solidity.

santiagorp avatar santiagorp commented on August 16, 2024

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

from emacs-solidity.

LefterisJP avatar LefterisJP commented on August 16, 2024

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.

from emacs-solidity.

LefterisJP avatar LefterisJP commented on August 16, 2024

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.

from emacs-solidity.

paulperegud avatar paulperegud commented on August 16, 2024

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

from emacs-solidity.

LefterisJP avatar LefterisJP commented on August 16, 2024

@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.

from emacs-solidity.

LefterisJP avatar LefterisJP commented on August 16, 2024

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

Can you check if your configuration is working better now?

from emacs-solidity.

paulperegud avatar paulperegud commented on August 16, 2024

@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)

from emacs-solidity.

paulperegud avatar paulperegud commented on August 16, 2024

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.

from emacs-solidity.

tbrooke avatar tbrooke commented on August 16, 2024

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))))

from emacs-solidity.

LefterisJP avatar LefterisJP commented on August 16, 2024

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

from emacs-solidity.

LefterisJP avatar LefterisJP commented on August 16, 2024

@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.

from emacs-solidity.

tbrooke avatar tbrooke commented on August 16, 2024

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

from emacs-solidity.

LefterisJP avatar LefterisJP commented on August 16, 2024

@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.

from emacs-solidity.

paulperegud avatar paulperegud commented on August 16, 2024

@LefterisJP problem is fixed, confirming!

from emacs-solidity.

LefterisJP avatar LefterisJP commented on August 16, 2024

Thanks Paul!

from emacs-solidity.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.