[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/arduino-mode 3fc0851 046/107: use define-derived-mode for
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/arduino-mode 3fc0851 046/107: use define-derived-mode for arduino-mode |
Date: |
Sun, 29 Aug 2021 10:58:14 -0400 (EDT) |
branch: elpa/arduino-mode
commit 3fc085198713baa0a1b7a844270cf17bdd57a10a
Author: stardiviner <numbchild@gmail.com>
Commit: stardiviner <numbchild@gmail.com>
use define-derived-mode for arduino-mode
---
arduino-mode.el | 52 ++++++++++++++++++----------------------------------
1 file changed, 18 insertions(+), 34 deletions(-)
diff --git a/arduino-mode.el b/arduino-mode.el
index 9184118..f4f994e 100644
--- a/arduino-mode.el
+++ b/arduino-mode.el
@@ -201,47 +201,31 @@ Each list item should be a regexp matching a single
identifier."
(switch-to-buffer port)
(serial-term port (or speed (serial-read-speed)))))
-
-;;;###autoload
-(add-to-list 'auto-mode-alist '("\\.pde\\'" . arduino-mode))
-;;;###autoload
-(add-to-list 'auto-mode-alist '("\\.ino\\'" . arduino-mode))
-
;;;###autoload
-(defun arduino-mode ()
- "Major mode for editing Arduino code.
-
-The hook `c-mode-common-hook' is run with no args at mode
-initialization, then `arduino-mode-hook'.
-
-Key bindings:
-\\{arduino-mode-map}"
- (interactive)
- (kill-all-local-variables)
+(define-derived-mode arduino-mode c-mode "arduino"
+ "Major mode for editing Arduino code."
+ ;; For `cc-mode' initialize.
(c-initialize-cc-mode t)
- (set-syntax-table arduino-mode-syntax-table)
- (setq major-mode 'arduino-mode
- mode-name "Arduino"
- local-abbrev-table arduino-mode-abbrev-table
- abbrev-mode t
- imenu-generic-expression cc-imenu-c-generic-expression)
- (use-local-map arduino-mode-map)
- ;; `c-init-language-vars' is a macro that is expanded at compile
- ;; time to a large `setq' with all the language variables and their
- ;; customized values for our language.
+ ;; `c-init-language-vars' is a macro that is expanded at compile time to a
+ ;; large `setq' with all the language variables and their customized values
+ ;; for our language.
(c-init-language-vars arduino-mode)
- ;; `c-common-init' initializes most of the components of a CC Mode
- ;; buffer, including setup of the mode menu, font-lock, etc.
- ;; There's also a lower level routine `c-basic-common-init' that
- ;; only makes the necessary initialization to get the syntactic
- ;; analysis and similar things working.
+ ;; `c-common-init' initializes most of the components of a CC Mode buffer,
+ ;; including setup of the mode menu, font-lock, etc. There's also a lower
+ ;; level routine `c-basic-common-init' that only makes the necessary
+ ;; initialization to get the syntactic analysis and similar things working.
(c-common-init 'arduino-mode)
+
(easy-menu-add arduino-menu)
(set (make-local-variable 'c-basic-offset) 2)
(set (make-local-variable 'tab-width) 2)
- (run-hooks 'c-mode-common-hook)
- (run-hooks 'arduino-mode-hook)
- (c-update-modeline))
+ )
+
+;;;###autoload
+(add-to-list 'auto-mode-alist '("\\.pde\\'" . arduino-mode))
+;;;###autoload
+(add-to-list 'auto-mode-alist '("\\.ino\\'" . arduino-mode))
+
(provide 'arduino-mode)
;;; arduino-mode.el ends here
- [nongnu] elpa/arduino-mode aed4acb 034/107: Add additional customization, (continued)
- [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, 2021/08/29
- [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 <=
- [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
- [nongnu] elpa/arduino-mode 8235a4a 065/107: fix mode-line-process not disappear after process failed, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 431c3ba 069/107: Merge branch 'develop', ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 9b1bdb8 060/107: support show process info in mode-line, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 1f154e4 063/107: add a command to create new Arduino sketch, ELPA Syncer, 2021/08/29