Home | History | Annotate | Download | only in editors

Lines Matching defs:mode

1 ;;; protobuf-mode.el --- major mode for editing protocol buffers.
37 ;; - Put `protobuf-mode.el' in your Emacs load-path.
39 ;; (require 'protobuf-mode)
41 ;; You can customize this mode just like any mode derived from CC Mode. If
42 ;; you want to add customizations specific to protobuf-mode, you can use the
43 ;; `protobuf-mode-hook'. For example, the following would make protocol-mode
48 ;; (indent-tabs-mode . nil)))
50 ;; (add-hook 'protobuf-mode-hook
53 ;; Refer to the documentation of CC Mode for more information about
54 ;; customization details and how to use this mode.
66 (require 'cc-mode)
72 ;; This mode does not inherit properties from other modes. So, we do not use
75 (put 'protobuf-mode 'c-mode-prefix "protobuf-"))
106 ;; cc-mode. So, we approximate as best we can.
159 "Minimal highlighting for protobuf-mode.")
162 "Fast normal highlighting for protobuf-mode.")
165 "Accurate normal highlighting for protobuf-mode.")
168 "Default expressions to highlight in protobuf-mode.")
172 (defvar protobuf-mode-syntax-table nil
173 "Syntax table used in protobuf-mode buffers.")
174 (or protobuf-mode-syntax-table
175 (setq protobuf-mode-syntax-table
176 (funcall (c-lang-const c-make-mode-syntax-table protobuf))))
178 (defvar protobuf-mode-abbrev-table nil
179 "Abbreviation table used in protobuf-mode buffers.")
181 (defvar protobuf-mode-map nil
182 "Keymap used in protobuf-mode buffers.")
183 (or protobuf-mode-map
184 (setq protobuf-mode-map (c-make-inherited-keymap)))
186 (easy-menu-define protobuf-menu protobuf-mode-map
187 "Protocol Buffers Mode Commands"
188 (cons "Protocol Buffers" (c-lang-const c-mode-menu protobuf)))
190 ;;;###autoload (add-to-list 'auto-mode-alist '("\\.proto\\'" . protobuf-mode))
193 (defun protobuf-mode ()
194 "Major mode for editing Protocol Buffers description language.
196 The hook `c-mode-common-hook' is run with no argument at mode
197 initialization, then `protobuf-mode-hook'.
200 \\{protobuf-mode-map}"
203 (set-syntax-table protobuf-mode-syntax-table)
204 (setq major-mode 'protobuf-mode
205 mode-name "Protocol-Buffers"
206 local-abbrev-table protobuf-mode-abbrev-table
207 abbrev-mode t)
208 (use-local-map protobuf-mode-map)
209 (c-initialize-cc-mode t)
212 (c-init-language-vars protobuf-mode)
213 (c-common-init 'protobuf-mode)
215 (c-run-mode-hooks 'c-mode-common-hook 'protobuf-mode-hook)
218 (provide 'protobuf-mode)
220 ;;; protobuf-mode.el ends here