[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/arduino-mode 20e284a 042/107: format code
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/arduino-mode 20e284a 042/107: format code |
Date: |
Sun, 29 Aug 2021 10:58:13 -0400 (EDT) |
branch: elpa/arduino-mode
commit 20e284acc63a31b2f46d2f08198c811fcc2dd89a
Author: stardiviner <numbchild@gmail.com>
Commit: stardiviner <numbchild@gmail.com>
format code
---
arduino-mode.el | 36 ++++++++++---------
ede-arduino.el | 109 ++++++++++++++++++++++++++++----------------------------
2 files changed, 74 insertions(+), 71 deletions(-)
diff --git a/arduino-mode.el b/arduino-mode.el
index 2dc0bcc..a1a53b3 100644
--- a/arduino-mode.el
+++ b/arduino-mode.el
@@ -118,7 +118,8 @@
(defcustom arduino-font-lock-extra-types nil
"*List of extra types (aside from the type keywords) to recognize in Arduino
mode.
-Each list item should be a regexp matching a single identifier." :group
'arduino)
+Each list item should be a regexp matching a single identifier."
+ :group 'arduino)
(defcustom arduino-executable "arduino"
"*The arduino executable"
@@ -139,6 +140,7 @@ Each list item should be a regexp matching a single
identifier." :group 'arduino
(defvar arduino-mode-syntax-table nil
"Syntax table used in arduino-mode buffers.")
+
(or arduino-mode-syntax-table
(setq arduino-mode-syntax-table
(funcall (c-lang-const c-make-mode-syntax-table arduino))))
@@ -158,22 +160,22 @@ Each list item should be a regexp matching a single
identifier." :group 'arduino
;; Add bindings which are only useful for Arduino
map)
"Keymap used in arduino-mode buffers.")
+
(define-key arduino-mode-map (kbd "C-c C-c") 'arduino-upload)
(define-key arduino-mode-map (kbd "C-c m") 'arduino-serial-monitor)
(easy-menu-define arduino-menu arduino-mode-map "Arduino Mode Commands"
(cons "Arduino" (c-lang-const c-mode-menu arduino)))
-; How does one add this directly to the Arduino menu in XEmacs?
(if (string-match "XEmacs" emacs-version)
(easy-menu-add-item arduino-menu
- (list "Micro-controller") ["Upload" arduino-upload t])
+ (list "Micro-controller") ["Upload"
arduino-upload t])
(easy-menu-add-item arduino-menu
- nil ["----" nil nil])
+ nil ["----" nil nil])
(easy-menu-add-item arduino-menu
- nil ["Upload" arduino-upload t])
+ nil ["Upload" arduino-upload t])
(easy-menu-add-item arduino-menu
- nil ["Serial monitor" arduino-serial-monitor t]))
+ nil ["Serial monitor" arduino-serial-monitor
t]))
(defcustom arduino-makefile-name "Makefile"
"Name of Makefile used to compile and upload Arduino sketches."
@@ -188,15 +190,15 @@ You will need a suitable Makefile. See URL
(interactive)
(if (file-exists-p arduino-makefile-name)
(progn
- (make-local-variable 'compile-command)
- (compile (concat "make -f " arduino-makefile-name " -k upload")))
+ (make-local-variable 'compile-command)
+ (compile (concat "make -f " arduino-makefile-name " -k upload")))
(if (y-or-n-p (concat "No Makefile `" arduino-makefile-name
- "' exists. Create it? "))
- (let ((arduino-project-name
- (file-name-nondirectory
- (file-name-sans-extension (buffer-file-name)))))
- (find-file-other-window arduino-makefile-name)
- (insert "# Customise the following values as required:
+ "' exists. Create it? "))
+ (let ((arduino-project-name
+ (file-name-nondirectory
+ (file-name-sans-extension (buffer-file-name)))))
+ (find-file-other-window arduino-makefile-name)
+ (insert "# Customise the following values as required:
TARGET = " arduino-project-name "
ARDUINO_LIBS =
@@ -211,16 +213,16 @@ ARDUINO_DIR = /usr/share/arduino
# http://mjo.tc/atelier/2009/02/arduino-cli.html
include /usr/share/arduino/Arduino.mk
")
- (message "Edit the Makefile as required and re-run arduino-upload."))
+ (message "Edit the Makefile as required and re-run
arduino-upload."))
(message (concat "No Makefile `" arduino-makefile-name "' exists.
Uploading cancelled.")))))
(unless (string-match "XEmacs" emacs-version)
(defun arduino-serial-monitor (port speed)
"Monitor the serial connection to the Arduino."
(interactive (list (serial-read-name) nil))
-
+
(if (get-buffer-process port)
- (switch-to-buffer port)
+ (switch-to-buffer port)
(serial-term port (or speed (serial-read-speed))))))
;;;###autoload
diff --git a/ede-arduino.el b/ede-arduino.el
index 8663980..68dae73 100644
--- a/ede-arduino.el
+++ b/ede-arduino.el
@@ -31,7 +31,6 @@
;; https://github.com/bookest/arduino-mode
(require 'ede)
-(require 'ede/auto) ; for `ede-project-autoload'
;;; Code:
(defcustom ede-arduino-makefile-name "Makefile"
@@ -120,7 +119,7 @@ ROOTPROJ is nil, sinc there is only one project for a
directory tree."
(progn
(message "Opening existing project")
proj)
-
+
;; Create a new project here.
(if root
(progn
@@ -139,23 +138,26 @@ ROOTPROJ is nil, sinc there is only one project for a
directory tree."
(message "Project loading/creation failed")))))
;;;###autoload
-(add-to-list 'ede-project-class-files
- (ede-project-autoload "arduino"
- :name "ARDUINO SKETCH"
- :file 'ede-arduino
- :proj-root-dirmatch
- (ede-project-autoload-dirmatch
- "arduino"
- :fromconfig (expand-file-name ede-arduino-preferences-file)
- :configregex "^sketchbook.path=\\([^\n]+\\)$"
- :configregexidx 1)
- :proj-file 'ede-arduino-file
- :proj-root 'ede-arduino-root
- :load-type 'ede-arduino-load
- :class-sym 'ede-arduino-project
- :safe-p t
- :new-p t)
- t)
+(require 'ede/auto) ; for `ede-project-autoload'
+;;;###autoload
+(add-to-list
+ 'ede-project-class-files
+ (ede-project-autoload "arduino"
+ :name "ARDUINO SKETCH"
+ :file 'ede-arduino
+ :proj-root-dirmatch
+ (ede-project-autoload-dirmatch
+ "arduino"
+ :fromconfig (expand-file-name
ede-arduino-preferences-file)
+ :configregex "^sketchbook.path=\\([^\n]+\\)$"
+ :configregexidx 1)
+ :proj-file 'ede-arduino-file
+ :proj-root 'ede-arduino-root
+ :load-type 'ede-arduino-load
+ :class-sym 'ede-arduino-project
+ :safe-p t
+ :new-p t)
+ t)
;;; CLASSES
;;
@@ -194,10 +196,10 @@ If one doesn't exist, create a new one for this
directory."
)
(when (not ans)
(setq ans (ede-arduino-target dir
- :name (file-name-nondirectory
- (directory-file-name dir))
- :path dir
- :source nil))
+ :name (file-name-nondirectory
+ (directory-file-name dir))
+ :path dir
+ :source nil))
(object-add-to-list proj :targets ans)
)
ans))
@@ -286,7 +288,7 @@ Argument COMMAND is the command to use for compiling the
target."
(defmethod ede-arduino-create-makefile ((proj ede-arduino-project))
"Create an arduino based Makefile for project PROJ."
(let* ((mfilename (expand-file-name ede-arduino-makefile-name
- (oref proj directory)))
+ (oref proj directory)))
(prefs (ede-arduino-sync))
(board (oref prefs boardobj))
(vers (ede-arduino-Arduino-Version))
@@ -376,7 +378,7 @@ Argument COMMAND is the command to use for compiling the
target."
(push lib libs)
)))))
(when (not orig-buffer) (kill-buffer buff)))))
- libs))
+ libs))
(defun ede-arduino-guess-sketch ()
"Return the file that is the core of the current project sketch."
@@ -403,7 +405,6 @@ Argument COMMAND is the command to use for compiling the
target."
(board :initform "uno")
(port :initform "/dev/ttyUSB1")
(sketchbook :initform "~/arduino")
-
(boardobj :initform nil)
)
"Class containing arduino preferences.")
@@ -432,33 +433,33 @@ Emacs back to the Arduino IDE."
(mod (nth 5 stats))
(board nil)
(kill nil))
-
+
(when (not ede-arduino-active-prefs)
(setq ede-arduino-active-prefs (ede-arduino-prefs "Arduino
Preferences")))
-
+
;; Only update the prefs if the prefs file changed.
(when (or (not (oref ede-arduino-active-prefs timestamp))
(/= (or (oref ede-arduino-active-prefs prefssize) 0) size)
(not (equal (oref ede-arduino-active-prefs timestamp) mod)))
-
+
(when (not buff)
(setq buff (find-file-noselect prefsfile)
kill t))
(with-current-buffer buff
(save-excursion
-
+
(goto-char (point-min))
(when (not (re-search-forward "^serial.port=" nil t))
(error "Cannot find serial.port from the arduino preferences"))
(oset ede-arduino-active-prefs port
(buffer-substring-no-properties (point) (point-at-eol)))
-
+
(goto-char (point-min))
(when (not (re-search-forward "^board=" nil t))
(error "Cannot find board from the arduino preferences"))
(setq board (buffer-substring-no-properties (point) (point-at-eol)))
(oset ede-arduino-active-prefs board board)
-
+
(goto-char (point-min))
(when (not (re-search-forward "^sketchbook.path=" nil t))
(error "Cannot find sketchbook.path from the arduino preferences"))
@@ -466,15 +467,15 @@ Emacs back to the Arduino IDE."
(file-name-as-directory
(expand-file-name
(buffer-substring-no-properties (point) (point-at-eol)))))
-
+
(when kill (kill-buffer buff))
-
+
(oset ede-arduino-active-prefs boardobj
(ede-arduino-board-data board))
-
+
(oset ede-arduino-active-prefs prefssize size)
(oset ede-arduino-active-prefs timestamp mod)
-
+
)))))
;;; Arduino Intuition
@@ -530,10 +531,10 @@ if configured"
(when (not (file-exists-p arduinofile))
;; Look up where it might be...
(setq arduinofile (locate-file arduinofile exec-path))
-
+
(when (not (file-exists-p arduinofile))
(error "Cannot find arduino command location"))
-
+
(let ((buff (get-file-buffer arduinofile))
(kill nil))
(when (not buff)
@@ -542,10 +543,10 @@ if configured"
(with-current-buffer buff
(save-excursion
(goto-char (point-min))
-
+
(when (not (re-search-forward "APPDIR=" nil t))
(error "Cannot find APPDIR from the arduino command"))
-
+
(prog1
(setq ede-arduino-appdir
(buffer-substring-no-properties (point)
(point-at-eol)))
@@ -600,9 +601,9 @@ If LIBRARY is not provided as an argument, just return the
library directory."
:documentation
"The SPEED of the arduino board's serial upload.")
(maximum-size :initarg :maximum-size
- :initform nil
- :documentation
- "The MAXIMUM_SIZE of the arduino board's uploadable target .")
+ :initform nil
+ :documentation
+ "The MAXIMUM_SIZE of the arduino board's uploadable target .")
(mcu :initarg :mcu
:initform nil
:documentation
@@ -630,51 +631,51 @@ Data returned is the intputs needed for the Makefile."
(mcu nil)
(f_cpu nil)
(core nil))
-
+
(when (not buff)
(setq buff (find-file-noselect (ede-arduino-boards.txt))
kill t))
-
+
(with-current-buffer buff
(save-excursion
-
+
(goto-char (point-min))
(when (not (re-search-forward (concat "^" boardname ".name=") nil t))
(error "Cannot find %s.name looking up board" boardname))
(setq name (buffer-substring-no-properties (point) (point-at-eol)))
-
+
(goto-char (point-min))
(when (not (re-search-forward (concat "^" boardname
".upload.protocol=") nil t))
(error "Cannot find %s.upload.protocol looking up board" boardname))
(setq protocol (buffer-substring-no-properties (point) (point-at-eol)))
-
+
(goto-char (point-min))
(when (not (re-search-forward (concat "^" boardname ".upload.speed=")
nil t))
(error "Cannot find %s.upload.speed looking up board" boardname))
(setq speed (buffer-substring-no-properties (point) (point-at-eol)))
-
+
(goto-char (point-min))
(when (not (re-search-forward (concat "^" boardname
".upload.maximum_size=") nil t))
(error "Cannot find %s.upload.maximum_size looking up board"
boardname))
(setq size (buffer-substring-no-properties (point) (point-at-eol)))
-
+
(goto-char (point-min))
(when (not (re-search-forward (concat "^" boardname ".build.mcu=") nil
t))
(error "Cannot find %s.build.mcu looking up board" boardname))
(setq mcu (buffer-substring-no-properties (point) (point-at-eol)))
-
+
(goto-char (point-min))
(when (not (re-search-forward (concat "^" boardname ".build.f_cpu=")
nil t))
(error "Cannot find %s.build.f_cpu looking up board" boardname))
(setq f_cpu (buffer-substring-no-properties (point) (point-at-eol)))
-
+
(goto-char (point-min))
(when (not (re-search-forward (concat "^" boardname ".build.core=")
nil t))
(error "Cannot find %s.build.core looking up board" boardname))
(setq core (buffer-substring-no-properties (point) (point-at-eol)))
-
+
(when kill (kill-buffer buff))
-
+
(ede-arduino-board boardname
:name name
:protocol protocol
- [nongnu] elpa/arduino-mode effb0bc 024/107: Sync with the language reference as of 20150503, (continued)
- [nongnu] elpa/arduino-mode effb0bc 024/107: Sync with the language reference as of 20150503, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 44c2728 025/107: Add to languages customisation group., ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode bb89ac8 030/107: Merge pull request #11 from bookest/bug/undefined-cl-macroexpand-all, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 241b179 032/107: Merge https://github.com/mavit/arduino-mode, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode aed4acb 034/107: Add additional customization, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode a468e63 035/107: Add basic support for file variables, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode d1233b1 036/107: Use configured preferences file for ede signature, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 9a168aa 038/107: fix void function `ede-project-autoload`, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 1424952 039/107: add new keywords, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 411815d 041/107: change arduino-upload keybinding to [C-c C-c], ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 20e284a 042/107: format code,
ELPA Syncer <=
- [nongnu] elpa/arduino-mode 59806cc 043/107: add .ino file extension to auto-mode-alist, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode a95ebba 044/107: remove XEmacs support part, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 3d8aa47 045/107: improve and add some commands for command-line arduino., ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 3fc0851 046/107: use define-derived-mode for arduino-mode, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 0150970 050/107: support org-mode babel Arduino src block, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 139b154 051/107: add support for --board option with header argument :boarder, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 3f0b3a4 057/107: rename command arduino-build -> arduino-verify, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 7b94f5b 058/107: creating process with make-process to use process sentinel to get notification., ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 714e0f0 059/107: add missing menu entries, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 6b549c8 064/107: add a command to add include-path file for irony, ELPA Syncer, 2021/08/29