bookest / arduino-mode Goto Github PK
View Code? Open in Web Editor NEWEmacs major mode for editing Arduino sketches.
Emacs major mode for editing Arduino sketches.
I started using this mode but it seems something is not working right.
The problem occurs after I typed in the first double-quote in the same line as #include.
something is runnung a infinite loop but no idea. (searching the library path?)
I've tested with Abbrev, gtags and doxymacs turned off but the same things happen.
Ubuntu 12.04LTS, emacs 23.3.1
grabbed the latest arduino-mode from github,
related code snipplets in emacs:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; doxymacs
(lazyload 'doxymacs-mode "doxymacs")
(lazyload 'gtags-mode "gtags")
(add-hook 'c-mode-common-hook
'(lambda()
(gtags-mode 1)
(gtags-make-complete-list)))
(add-hook 'c-mode-common-hook 'doxymacs-mode)
(add-hook 'c++-mode-hook 'doxymacs-mode)
(defun bind-m-ret-to-comment-line ()
(define-key c-mode-map (kbd "<M-return>") 'c-indent-new-comment-line))
(add-hook 'c-mode-hook 'bind-m-ret-to-comment-line)
(add-hook 'c++-mode-hook 'bind-m-ret-to-comment-line)
(defun my-doxymacs-font-lock-hook ()
(if (or (eq major-mode 'c-mode) (eq major-mode 'c++-mode))
(doxymacs-font-lock)))
(add-hook 'font-lock-mode-hook 'my-doxymacs-font-lock-hook)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Arduino mode
(add-to-list 'load-path (site "arduino-mode/"))
(add-to-list 'auto-mode-alist
'("\\.\\(pde\\|ino\\)$" . arduino-mode))
(lazyload 'arduino-mode "arduino-mode")
Just curious since it's been 10 months since the last update.
I wanted to add it to MELPA
Steps to reproduce:
emacs -Q
Evaluate the following code to load arduino-mode
and no other packages:
(require 'package)
(setq package-load-list
'((arduino-mode t) ))
(package-initialize)
Turn on mode with M-x arduino-mode
.
The following errors appear in Messages, and the mode doesn't start:
Eval error in the ‘c-lang-defconst’ for ‘c-constant-kwds’ in arduino-mode:
Eval error in the ‘c-lang-defconst’ for ‘c-basic-matchers-before’ in arduino-mode:
Eval error in the ‘c-lang-defconst’ for ‘c-matchers-2’ in arduino-mode:
c-get-lang-constant: Invalid function: (append (quote ("HIGH" "LOW" "INPUT" "OUTPUT" "INPUT_PULLUP" "LED_BUILTIN" "true" "false")) (c-get-lang-constant (quote c-constant-kwds) (quote (cc-langs))))
Emacs:
GNU Emacs 25.0.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.6) of 2015-12-29
arduino-mode (from melpa):
;; Package-Version: 20151017.2335
;; Version: 1.0
When upgrading arduino-mode
today, noticed the following compilation error:
Compiling file /Users/dpc/.emacs.d/elpa/arduino-mode-20180508.438/arduino-mode.el at Tue May 8 12:47:19 2018
arduino-mode.el:35:1:Error: Cannot open load file: No such file or directory, spinner
arduino-mode.el
;;; Code:
(require 'cc-mode)
(require 'spinner)
Eval error in the ‘c-lang-defconst’ for ‘c-constant-kwds’ in arduino-mode:
Eval error in the ‘c-lang-defconst’ for ‘c-basic-matchers-before’ in arduino-mode:
Eval error in the ‘c-lang-defconst’ for ‘c-matchers-2’ in arduino-mode:
Invalid function: (append (quote ("HIGH" "LOW" "INPUT" "OUTPUT" "INPUT_PULLUP" "LED_BUILTIN" "true" "false")) (c-get-lang-constant (quote c-constant-kwds) (quote (cc-langs))))
then it freeze at spacebar hit time
Hi all,
I am having a bit of problem running this mode.
I put arduino-mode.el in this folder ~/.emacs/vendor/arduino-mode.el
I added following line in my .emacs files:
(add-to-list 'load-path "~/.emacs.d/vendor/arduino-mode")
(setq auto-mode-alist (cons '(".(pde|ino)$" . arduino-mode) auto-mode-alist))
(autoload 'arduino-mode "arduino-mode" "Arduino editing mode." t)
But it failed to open, I tried to modify first line to:
(add-to-list 'load-path "~/.emacs.d/vendor/arduino-mode.el")
it's still not working, I tried to enable the mode manually by doing M-x arduino-mode. It gives out this error message:
Cannot open load file: arduino-mode
Any idea what's went wrong?
Thanks
Here is the error output in *Messages*
:
Eval error in the `c-lang-defvar' or `c-lang-setver' for `c-known-type-key' (source eval): (wrong-type-argument sequencep t)
Error during redisplay: (jit-lock-function 542) signaled (wrong-type-argument stringp nil)
Since it is the oficial one, the interface looks less troublesome than setting up arduinomk. I've been a week trying to make it work but can't compile nor upload files. Arduino-cli seems pretty robust. Is this project still maintained?
When I load arduino-mode with use-package (use-package arduino-mode)
. I got this error:
(invalid-function (append '("HIGH" "LOW" "INPUT" "OUTPUT" "INPUT_PULLUP" "LED_BUILTIN" "true" "false") (c-get-lang-constant 'c-constant-kwds '(cc-langs))))
signal(invalid-function ((append '("HIGH" "LOW" "INPUT" "OUTPUT" "INPUT_PULLUP" "LED_BUILTIN" "true" "false") (c-get-lang-constant 'c-constant-kwds '(cc-langs)))))
c-get-lang-constant(c-matchers-2 (cc-fonts) arduino-mode)
(defconst arduino-font-lock-keywords-2 (c-get-lang-constant 'c-matchers-2 '(cc-fonts) 'arduino-mode) ("/home/stardiviner/.emacs.d/elpa/arduino-mode-20151017.2335/arduino-mode.elc" . 2383))
#(arduino-mode nil noerror)
ad-Advice-require(# arduino-mode nil noerror)
apply(ad-Advice-require # (arduino-mode nil noerror))
require(arduino-mode nil noerror)
(not (require 'arduino-mode nil 'noerror))
When I use (require 'arduino-mode)
, got this error:
c-get-lang-constant: ‘c-matchers-2’ got no (prior) value in arduino-mode (might be a cyclic reference)
My Emacs version: 25.1.50.5
I don't know how but completions never work
company-arduino was always installed but completions don't work at all.
Switching to c++-mode completions work wonderfully, but then back to arduino mode and it is gone again.
I am unable to even guess what the problem can be.
In arduino-mode
the keymap is set as (use-local-map c-mode-map)
so it doesn't actually use the arduino-mode-map
.
This makes it impossible to define arduino specific keys.
The code should really be (use-local-map arduino-mode-map)
I kinda think this mode should probably have been created using define-derived-mode
instead of the template from http://cc-mode.sourceforge.net/derived-mode-ex.el
It looks like arduino-mode uses cl-macroexpand-all which has been deprecated in favor of macroexpand-all so I'm getting this error "Symbol's function definition is void: cl-macroexpand-all" when I try to install it. See http://emacs.stackexchange.com/questions/2864/symbols-function-definition-is-void-cl-macroexpand-all-when-trying-to-instal. I am using emacs 24.4.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.