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

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

[nongnu] elpa/dart-mode 9b1c871 001/192: Beginning of dart-mode.


From: ELPA Syncer
Subject: [nongnu] elpa/dart-mode 9b1c871 001/192: Beginning of dart-mode.
Date: Sun, 29 Aug 2021 11:01:39 -0400 (EDT)

branch: elpa/dart-mode
commit 9b1c8711b1851294d35451bf0e85d0e8a00f07c6
Author: Nathan Weizenbaum <nweiz@google.com>
Commit: Nathan Weizenbaum <nweiz@google.com>

    Beginning of dart-mode.
    
    Currently just works like java-mode.
---
 dart-mode.el | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)

diff --git a/dart-mode.el b/dart-mode.el
new file mode 100644
index 0000000..1740e91
--- /dev/null
+++ b/dart-mode.el
@@ -0,0 +1,72 @@
+;;; dart-mode.el --- Major mode for editing Dart files
+
+;; Copyright (C) 2011 Google Inc.
+
+;; Author: Nathan Weizenbaum
+;; URL: http://code.google.com/p/dart-mode
+;; Version 0.0
+;; Keywords: language
+
+;;; Commentary:
+
+;; To install, save this on your load path and add the following to
+;; your .emacs file:
+;;
+;; (require 'dart-mode)
+
+;;; Code:
+
+(require 'cc-mode)
+
+(eval-and-compile (c-add-language 'dart-mode 'java-mode))
+
+(defcustom dart-font-lock-extra-types nil
+  "*List of extra types (aside from the type keywords) to recognize in DART 
mode.
+Each list item should be a regexp matching a single identifier.")
+
+(defconst dart-font-lock-keywords-1 (c-lang-const c-matchers-1 dart)
+  "Minimal highlighting for Dart mode.")
+
+(defconst dart-font-lock-keywords-2 (c-lang-const c-matchers-2 dart)
+  "Fast normal highlighting for Dart mode.")
+
+(defconst dart-font-lock-keywords-3 (c-lang-const c-matchers-3 dart)
+  "Accurate normal highlighting for Dart mode.")
+
+(defvar dart-font-lock-keywords dart-font-lock-keywords-3
+  "Default expressions to highlight in Dart mode.")
+
+(defvar dart-mode-syntax-table nil
+  "Syntax table used in dart-mode buffers.")
+(unless dart-mode-syntax-table
+  (setq dart-mode-syntax-table
+        (funcall (c-lang-const c-make-mode-syntax-table dart))))
+
+
+;;; Initialization
+
+;;;###autoload (add-to-list 'auto-mode-alist '("\\.dart\\'" . dart-mode))
+
+;;;###autoload
+(defun dart-mode ()
+  "Major mode for editing Dart files.
+
+The hook `c-mode-common-hook' is run with no args at mode
+initialization, then `dart-mode-hook'.
+
+Key bindings:
+\\{dart-mode-map}"
+  (interactive)
+  (kill-all-local-variables)
+  (c-initialize-cc-mode t)
+  (setq major-mode 'dart-mode
+        mode-name "Dart")
+  (c-init-language-vars dart-mode)
+  (c-common-init 'dart-mode)
+  (run-hooks 'c-mode-common-hook)
+  (run-hooks 'dart-mode-hook)
+  (c-update-modeline))
+
+(provide 'dart-mode)
+
+;; dart-mode.el ends here



reply via email to

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