nix-archive-1(type directoryentry(namesharenode(type directoryentry(nameemacsnode(type directoryentry(name site-lispnode(type directoryentry(name dts-mode-1.0node(type directoryentry(namedts-mode-autoloads.elnode(typeregularcontents©;;; dts-mode-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*- ;; Generated by the `loaddefs-generate' function. ;; This file is part of GNU Emacs. ;;; Code: ;;; Generated autoloads from dts-mode.el (autoload 'dts-mode "dts-mode" "\ Major mode for editing Device Tree source files. (fn)" t) (add-to-list 'auto-mode-alist '("\\.dtsi?\\'" . dts-mode)) (register-definition-prefixes "dts-mode" '("dts-")) ;;; End of scraped data (provide 'dts-mode-autoloads) ;; Local Variables: ;; version-control: never ;; no-update-autoloads: t ;; no-native-compile: t ;; coding: utf-8-emacs-unix ;; End: ;;; dts-mode-autoloads.el ends here ))entry(namedts-mode-autoloads.elcnode(typeregularcontentsß;ELC ;;; Compiled ;;; in Emacs version 29.4 ;;; with all optimizations. (when (boundp 'comp--no-native-compile) (puthash load-file-name t comp--no-native-compile)) #@56 Major mode for editing Device Tree source files. (fn) (autoload 'dts-mode "dts-mode" '(#$ . 178) t) (byte-code "\300\301\302\"\210\303\304\305\"\210\306\307!\207" [add-to-list auto-mode-alist ("\\.dtsi?\\'" . dts-mode) register-definition-prefixes "dts-mode" ("dts-") provide dts-mode-autoloads] 3) ))entry(namedts-mode-pkg.elnode(typeregularcontents’;; Generated package description from dts-mode.el -*- no-byte-compile: t -*- (define-package "dts-mode" "1.0" "Major mode for Device Tree source files" '((emacs "24")) :commit "8413d2dc9b3347831aa9e8c8b2524af3ef005441" :url "https://elpa.gnu.org/packages/dts-mode.html" :authors '(("Ben Gamari" . "ben@smart-cactus.org")) :maintainer '("Ben Gamari" . "ben@smart-cactus.org") :keywords '("languages")) ))entry(name dts-mode.elnode(typeregularcontents;;; dts-mode.el --- Major mode for Device Tree source files -*- lexical-binding: t; -*- ;; Copyright (C) 2014-2022 Free Software Foundation, Inc. ;; Version: 1.0 ;; Author: Ben Gamari ;; Package-Requires: ((emacs "24")) ;; Keywords: languages ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . ;;; Commentary: ;; This provides basic editing support for DTS files (see ;; http://www.devicetree.org/), with the following features: ;; ;; - Font-lock highlighting ;; - SMIE-based automatic indentation ;;; News: ;; In Version 1.0: ;; - Always use SMIE ;; - Require Emacs≄24 ;; In Version 0.1.1: ;; - Add SMIE-based indentation ;;; Code: (defconst dts-re-ident "\\([[:alpha:]_][[:alnum:]_,-]*\\)") (defvar dts-mode-font-lock-keywords `( ;; Names like `name: hi {` (,(concat dts-re-ident ":") 1 font-lock-variable-name-face) ;; Nodes (,(concat dts-re-ident "\\(@[[:xdigit:]]+\\)?[[:space:]]*{") (1 font-lock-type-face)) ;; Assignments (,(concat dts-re-ident "[[:space:]]*=") 1 font-lock-variable-name-face) (,(concat dts-re-ident "[[:space:]]*;") 1 font-lock-variable-name-face) ;; References (,(concat "&" dts-re-ident) 1 font-lock-variable-name-face) ) ) (defvar dts-mode-syntax-table (let ((table (make-syntax-table))) (modify-syntax-entry ?< "(>" table) (modify-syntax-entry ?> ")<" table) (modify-syntax-entry ?& "." table) (modify-syntax-entry ?| "." table) (modify-syntax-entry ?~ "." table) ;; _ and , are both symbol constituents. (modify-syntax-entry ?, "_" table) (modify-syntax-entry ?_ "_" table) ;; Strings (modify-syntax-entry ?\" "\"" table) (modify-syntax-entry ?\\ "\\" table) ;; Comments (modify-syntax-entry ?/ ". 124b" table) (modify-syntax-entry ?* ". 23" table) (modify-syntax-entry ?\n "> b" table) (modify-syntax-entry ?\^m "> b" table) table)) ;;;; Original manual indentation code. (defun dts--calculate-indentation () (declare (obsolete indent-according-to-mode "1.0")) (save-excursion (let ((end (point-at-eol)) (cnt 0) (initial-point (point))) (goto-char 0) (while (re-search-forward "\\([{}]\\)" end t) (if (string= (match-string-no-properties 0) "{") (setq cnt (1+ cnt)) (setq cnt (1- cnt)))) ;; subtract one if the current line has an opening brace since we ;; shouldn't add the indentation level until the following line (goto-char initial-point) (beginning-of-line) (when (re-search-forward "{" (point-at-eol) t) (setq cnt (1- cnt))) cnt))) (defun dts-indent-line () "Old indentation algorithm." (declare (obsolete indent-according-to-mode "1.0")) (interactive) (let ((indent (with-no-warnings (dts--calculate-indentation)))) (save-excursion (indent-line-to (* indent tab-width))) (when (or (bolp) (looking-back "^[[:space:]]+" (line-beginning-position))) (beginning-of-line-text)))) ;;;; New SMIE-based indentation code. ;; Compatibility macro. (defmacro dts--using-macro (name exp) (declare (indent 1) (debug (symbolp form))) (if (fboundp name) ;If macro exists at compiler-time, just use it. exp `(when (fboundp ',name) ;Else, check if it exists at run-time. (eval ',exp)))) ;If it does, then run the code. (require 'smie nil t) (defconst dts-grammar ;; FIXME: The syntax-table gives symbol-constituent syntax to the comma, ;; but the comma is also used as a separator! (when (fboundp 'smie-prec2->grammar) (smie-prec2->grammar (smie-bnf->prec2 '((id) (val ("<" val ">")) (exp ("{" exps "}") ;; The "foo,bar = toto" can be handled either by considering ;; "foo,bar" as a single token or as 3 tokens. ;; Currently I consider it as 3 tokens, so the LHS of "=" can't be ;; just `id' but has to be `vals'. (vals "=" vals)) (exps (exp) (exps ";" exps)) (vals (val "," val))) '((assoc ";")) '((assoc ",")))))) (defun dts-indent-rules (kind token) (dts--using-macro pcase (pcase (cons kind token) (`(:elem . basic) tab-width) ;; (`(:elem . args) 0) (`(:list-intro . "") ;FIXME: Not sure why we get "" here! ;; After < we either have a plain list of data, as in: "operating-points ;; = <1008000 1400000 ...>" or we have sometimes "refs with args" as in ;; "clocks = <&apb1_gates 6>;". (and (eq (char-before) ?<) (not (looking-at "&")))) (`(:before . "{") (smie-rule-parent)) (`(:before . "<") (if (smie-rule-hanging-p) (smie-rule-parent))) (`(:after . "=") (dts-indent-rules :elem 'basic)) ))) ;;;; The major mode itself. (defalias 'dts-parent-mode (if (fboundp 'prog-mode) 'prog-mode 'fundamental-mode)) ;;;###autoload (define-derived-mode dts-mode dts-parent-mode "Devicetree";DTS would be shorter! "Major mode for editing Device Tree source files." ;; Fonts (set (make-local-variable 'font-lock-defaults) '(dts-mode-font-lock-keywords nil nil nil nil)) (set (make-local-variable 'comment-start) "/* ") (set (make-local-variable 'comment-end) " */") (set (make-local-variable 'comment-multi-line) t) ;; This is not specific to the DTS format, really, but DTS is mostly ;; used in the context of the Linux kernel (and U-boot loader) where ;; there's a strong preference to indent with TABs. (set (make-local-variable 'indent-tabs-mode) t) (dts--using-macro syntax-propertize-rules (set (make-local-variable 'syntax-propertize-function) (syntax-propertize-rules ("#include[ \t]+\\(<\\).*\\(>\\)" (1 "|") (2 "|")) ;; Treat things like /delete-property/ as a single identifier. ("\\(/\\)[a-z]+\\(/\\)" (1 "_") (2 "_"))))) (smie-setup dts-grammar #'dts-indent-rules)) ;;;###autoload (add-to-list 'auto-mode-alist '("\\.dtsi?\\'" . dts-mode)) (provide 'dts-mode) ;;; dts-mode.el ends here ))entry(name dts-mode.elcnode(typeregularcontentsL;ELC ;;; Compiled ;;; in Emacs version 29.4 ;;; with all optimizations. (defconst dts-re-ident "\\([[:alpha:]_][[:alnum:]_,-]*\\)") (defvar dts-mode-font-lock-keywords (byte-code "\301P\302B\303P\304B\305P\306B\307P\310B\311P\312B\257\207" [dts-re-ident ":" (1 font-lock-variable-name-face) "\\(@[[:xdigit:]]+\\)?[[:space:]]*{" ((1 font-lock-type-face)) "[[:space:]]*=" (1 font-lock-variable-name-face) "[[:space:]]*;" (1 font-lock-variable-name-face) "&" (1 font-lock-variable-name-face)] 6)) (defvar dts-mode-syntax-table (byte-code "\300 \301\302\303#\210\301\304\305#\210\301\306\307#\210\301\310\307#\210\301\311\307#\210\301\312\313#\210\301\314\313#\210\301\315\316#\210\301\317\320#\210\301\321\322#\210\301\323\324#\210\301\325\326#\210\301\327\326#\210\207" [make-syntax-table modify-syntax-entry 60 "(>" 62 ")<" 38 "." 124 126 44 "_" 95 34 "\"" 92 "\\" 47 ". 124b" 42 ". 23" 10 "> b" 13] 5)) (defalias 'dts--calculate-indentation #[0 "\212\300 \301`\301b\210\302\303\304#\203&\305\301!\306\230\203T\262\202S\262\202\211b\210\307 \210\302\306\300 \304#\2039S\262\266\203)\207" [point-at-eol 0 re-search-forward "\\([{}]\\)" t match-string-no-properties "{" beginning-of-line] 7]) (make-obsolete 'dts--calculate-indentation 'indent-according-to-mode "1.0")#@28 Old indentation algorithm. (defalias 'dts-indent-line #[0 "\301 \212\302_!)\210n\204\303\304\305 \"\205\306 \207" [tab-width dts--calculate-indentation indent-line-to looking-back "^[[:space:]]+" line-beginning-position beginning-of-line-text] 4 (#$ . 1312) nil]) (make-obsolete 'dts-indent-line 'indent-according-to-mode "1.0")#@17 (fn NAME EXP) (defalias 'dts--using-macro '(macro . #[514 "\300!\203\207\301\300\302DD\303\302DDE\207" [fboundp when quote eval] 7 (#$ . 1652)])) (byte-code "\300\301\302\303#\304\301\305\306#\210\307\310\311\312#\207" [function-put dts--using-macro lisp-indent-function 1 put edebug-form-spec (symbolp form) require smie nil t] 5) (defconst dts-grammar (byte-code "\300\301!\205\302\207" [fboundp smie-prec2->grammar ((:smie-closer-alist (#4="<" . #3=">") (#2="{" . #1="}")) (#1# 0 (47)) (";" 12 12) ("=" 24 23) ("," 36 35) (#2# (48) 0) (#3# 1 (49)) (#4# (50) 1))] 2))#@19 (fn KIND TOKEN) (defalias 'dts-indent-rules #[514 "B\211:\205h\211\242\211\301\267\202e\243\211\302=\205\262\202f\243\211\303\232\2052`Sf\304=\2052\305\306!?\262\202f\243\211\307\267\202N\310 \202O\311 \205O\310 \202O\312\262\202f\243\211\313\232\205`\314\315\302\"\262\202f\312\262\207" [tab-width #s(hash-table size 4 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (:elem 16 :list-intro 30 :before 55 :after 84)) basic "" 60 looking-at "&" #s(hash-table size 2 test equal rehash-size 1.5 rehash-threshold 0.8125 purecopy t data ("{" 63 "<" 68)) smie-rule-parent smie-rule-hanging-p nil "=" dts-indent-rules :elem] 8 (#$ . 2236)]) (byte-code "\300\301\302\303!\203\f\303\202 \304\"\207" [defalias dts-parent-mode fboundp prog-mode fundamental-mode] 4) (defvar dts-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [dts-mode-hook variable-documentation put "Hook run after entering Devicetree mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp dts-mode-map definition-name dts-mode] 4) (defvar dts-mode-map (make-sparse-keymap)) (byte-code "\301\302N\204\303\301\302\304\305!#\210\306\307!\204*\303\307\310\311#\210\312\307\306\307!\203&\313\202(\314 \"\210\307\302N\2048\303\307\302\304\315!#\210\306\300!\204X\303\300\310\311#\210\312\300\306\300!\203P\313\202V\316\300\313\"\210\"\210\300\302N\204f\303\300\302\304\317!#\210\303\311\320\321#\207" [dts-mode-abbrev-table dts-mode-map variable-documentation put purecopy "Keymap for `dts-mode'." boundp dts-mode-syntax-table definition-name dts-mode defvar-1 nil make-syntax-table "Syntax table for `dts-mode'." define-abbrev-table "Abbrev table for `dts-mode'." derived-mode-parent dts-parent-mode] 5)#@240 Major mode for editing Device Tree source files. In addition to any hooks its parent mode `dts-parent-mode' might have run, this mode runs the hook `dts-mode-hook', as the final or penultimate step during initialization. \{dts-mode-map} (defalias 'dts-mode #[0 "\306\300!\210\307\310 \210\311\312\310\313N\203\314\311\313\310\313N#\210\315 !\204'\316 \317 \"\210\320\f!\211\2035\211\321 =\203;\322\f\323 \"\210\210\324 \325\"\204R '=\204R\326 \325'C#\210\327 !\210\330\f!\210 '\306\331!\210\332\306\333!\210\334\306\335!\210\336\306\337!\210\307\306\340!\210\307 \306\341!\210\342!\343(\344\")\210\345\346!\207" [delay-mode-hooks major-mode mode-name dts-mode-map dts-mode-syntax-table dts-mode-abbrev-table make-local-variable t dts-parent-mode dts-mode "Devicetree" mode-class put keymap-parent set-keymap-parent current-local-map char-table-parent standard-syntax-table set-char-table-parent syntax-table abbrev-table-get :parents abbrev-table-put use-local-map set-syntax-table font-lock-defaults (dts-mode-font-lock-keywords nil nil nil nil) comment-start "/* " comment-end " */" comment-multi-line indent-tabs-mode syntax-propertize-function #[514 "b\210`W\205c\300\301\302#\205c\303\224\204\304\224\203:\303\224\203)\305\303\224\303\225\306\307$\210\304\224\203\305\304\224\304\225\306\307$\210\202\310\224\204D\311\224\203\310\224\203R\305\310\224\310\225\306\312$\210\311\224\203\305\311\224\311\225\306\312$\210\202\207" [re-search-forward "#include[ ]+\\(<\\).*\\(>\\)\\|\\(/\\)[a-z]+\\(/\\)" t 1 2 put-text-property syntax-table (15) 3 4 (3)] 7 "\n\n(fn START END)"] smie-setup dts-indent-rules run-mode-hooks dts-mode-hook local-abbrev-table dts-grammar] 5 (#$ . 4105) nil]) (byte-code "\300\301\302\"\210\303\304!\207" [add-to-list auto-mode-alist ("\\.dtsi?\\'" . dts-mode) provide dts-mode] 3) )))))))))))