Skip to content

Commit

Permalink
Add a tiny mode for .bazeliskrc files (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
phst authored Apr 17, 2023
1 parent 8c99096 commit 0ef4adb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
11 changes: 11 additions & 0 deletions bazel.el
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,17 @@ and Info node ‘(elisp) Syntax Table Internals’."
(put-text-property (point) (1+ (point))
'syntax-table '(12)))))))

;;;; ‘bazeliskrc-mode’

;;;###autoload
(define-derived-mode bazeliskrc-mode conf-unix-mode
"Major mode for editing .bazeliskrc files.")

;;;###autoload
(add-to-list 'auto-mode-alist
;; https://github.com/bazelbuild/bazelisk#bazeliskrc-configuration-file
(cons (rx "/.bazeliskrc" eos) #'bazeliskrc-mode))

;;;; Menu item

(easy-menu-add-item
Expand Down
19 changes: 11 additions & 8 deletions manual.org
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021, 2022 Google LLC
# Copyright 2021, 2022, 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -36,17 +36,20 @@ This manual describes ~bazel.el~, a GNU Emacs package to work with the
#+FINDEX: bazel-workspace-mode
#+FINDEX: bazelrc-mode
#+FINDEX: bazelignore-mode
#+FINDEX: bazeliskrc-mode
#+FINDEX: bazel-starlark-mode
The package provides five major modes for editing Bazel-related files:
~bazel-build-mode~ for BUILD files, ~bazel-workspace-mode~ for WORKSPACE files,
~bazelrc-mode~ for =.bazelrc= configuration files, ~bazelignore-mode~ for
=.bazelignore= files, and ~bazel-starlark-mode~ for extension files written in
the Starlark language. These modes also extend Imenu and the
~find-file-at-point~ to support Bazel-specific syntax. See the
[[https://docs.bazel.build/guide.html][Bazel user guide]], the
[[https://docs.bazel.build/build-ref.html][Bazel reference]], and the
[[https://docs.bazel.build/skylark/concepts.html][Starlark reference]] for
background on these file types.
=.bazelignore= files, ~bazeliskrc-mode~ for =.bazeliskrc= files, and
~bazel-starlark-mode~ for extension files written in the Starlark language.
These modes also extend Imenu and the ~find-file-at-point~ to support
Bazel-specific syntax. See the [[https://docs.bazel.build/guide.html][Bazel
user guide]], the [[https://docs.bazel.build/build-ref.html][Bazel reference]],
the
[[https://github.com/bazelbuild/bazelisk/blob/master/README.md#bazeliskrc-configuration-file][Bazelisk
README]], and the [[https://docs.bazel.build/skylark/concepts.html][Starlark
reference]] for background on these file types.

#+FINDEX: bazel-mode
Since the syntax for BUILD files, WORKSPACE files, and Starlark files is
Expand Down

0 comments on commit 0ef4adb

Please sign in to comment.