emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/arduino-mode 1f154e4 063/107: add a command to create new


From: ELPA Syncer
Subject: [nongnu] elpa/arduino-mode 1f154e4 063/107: add a command to create new Arduino sketch
Date: Sun, 29 Aug 2021 10:58:17 -0400 (EDT)

branch: elpa/arduino-mode
commit 1f154e46d1435e27cc433176a2e5b575c5f220b8
Author: stardiviner <numbchild@gmail.com>
Commit: stardiviner <numbchild@gmail.com>

    add a command to create new Arduino sketch
---
 arduino-mode.el | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/arduino-mode.el b/arduino-mode.el
index fae48c1..125fd3c 100644
--- a/arduino-mode.el
+++ b/arduino-mode.el
@@ -44,6 +44,16 @@
   ;; fall back on c-mode
   (c-add-language 'arduino-mode 'c-mode))
 
+(defgroup arduino-mode nil
+  "Customize arduino-mode."
+  :prefix "arduino-mode-"
+  :group 'arduino)
+
+(defcustom arduino-mode-home "~/Arduino"
+  "The path of ARDUINO_HOME."
+  :type 'directory
+  :group 'arduino-mode)
+
 (c-lang-defconst c-primitive-type-kwds
   arduino (append '(;; Data Types
                     "boolean" "byte"
@@ -278,6 +288,14 @@ Each list item should be a regexp matching a single 
identifier."
     (serial-term port (or speed (serial-read-speed)))))
 
 ;;;###autoload
+(defun arduino-sketch-new (sketch)
+  "A command to create new `SKETCH' in ARDUINO_HOME (~/Arduino)."
+  (interactive (list (read-from-minibuffer "Arduino new sketch file: ")))
+  (let ((default-directory (expand-file-name arduino-mode-home)))
+    (find-file sketch)))
+
+
+;;;###autoload
 (define-derived-mode arduino-mode c-mode "arduino"
   "Major mode for editing Arduino code."
   ;; For `cc-mode' initialize.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]