Lines Matching full: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)
75 ;; This mode does not inherit properties from other modes. So, we do not use
78 (put 'protobuf-mode 'c-mode-prefix "protobuf-"))
109 ;; cc-mode. So, we approximate as best we can.
162 "Minimal highlighting for protobuf-mode.")
165 "Fast normal highlighting for protobuf-mode.")
168 "Accurate normal highlighting for protobuf-mode.")
171 "Default expressions to highlight in protobuf-mode.")
175 (defvar protobuf-mode-syntax-table nil
176 "Syntax table used in protobuf-mode buffers.")
177 (or protobuf-mode-syntax-table
178 (setq protobuf-mode-syntax-table
179 (funcall (c-lang-const c-make-mode-syntax-table protobuf))))
181 (defvar protobuf-mode-abbrev-table nil
182 "Abbreviation table used in protobuf-mode buffers.")
184 (defvar protobuf-mode-map nil
185 "Keymap used in protobuf-mode buffers.")
186 (or protobuf-mode-map
187 (setq protobuf-mode-map (c-make-inherited-keymap)))
189 (easy-menu-define protobuf-menu protobuf-mode-map
190 "Protocol Buffers Mode Commands"
191 (cons "Protocol Buffers" (c-lang-const c-mode-menu protobuf)))
193 ;;;###autoload (add-to-list 'auto-mode-alist '("\\.proto\\'" . protobuf-mode))
196 (defun protobuf-mode ()
197 "Major mode for editing Protocol Buffers description language.
199 The hook `c-mode-common-hook' is run with no argument at mode
200 initialization, then `protobuf-mode-hook'.
203 \\{protobuf-mode-map}"
206 (set-syntax-table protobuf-mode-syntax-table)
207 (setq major-mode 'protobuf-mode
208 mode-name "Protocol-Buffers"
209 local-abbrev-table protobuf-mode-abbrev-table
210 abbrev-mode t)
211 (use-local-map protobuf-mode-map)
212 (c-initialize-cc-mode t)
215 (c-init-language-vars protobuf-mode)
216 (c-common-init 'protobuf-mode)
218 (c-run-mode-hooks 'c-mode-common-hook 'protobuf-mode-hook)
221 (provide 'protobuf-mode)
223 ;;; protobuf-mode.el ends here