Skip to content

Commit

Permalink
fix: move keymap definition
Browse files Browse the repository at this point in the history
  • Loading branch information
russell committed May 7, 2022
1 parent 6ed8161 commit 1bec9d9
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions cue-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,18 @@ it should move backward to the beginning of the previous token."
table)
"Syntax table for `cue-mode'.")

(defvar cue-mode-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "C-c C-c") 'cue-eval-buffer)
(define-key map (kbd "C-c C-r") 'cue-reformat-buffer)
map)
"Keymap used in CUE mode.")

;;;###autoload
(define-derived-mode cue-mode prog-mode "CUE language Mode"
(define-derived-mode cue-mode prog-mode "CUE Mode"
"Major mode for editing CUE files.
\\{cue-mode-map}"
:syntax-table cue-mode-syntax-table
(setq-local font-lock-defaults '(cue-font-lock-keywords ;; keywords
nil ;; keywords-only
Expand Down Expand Up @@ -359,9 +368,6 @@ it should move backward to the beginning of the previous token."
(goto-char origional-point)))
(display-buffer outbuf '(nil (allow-no-window . t)))))))

(define-key cue-mode-map (kbd "C-c C-c") 'cue-eval-buffer)


;;;###autoload
(defun cue-reformat-buffer ()
"Reformat entire buffer using the CUE format utility."
Expand Down Expand Up @@ -408,7 +414,5 @@ it should move backward to the beginning of the previous token."
((window-height . fit-window-to-buffer))))))))
(delete-file stderr-file))))

(define-key cue-mode-map (kbd "C-c C-r") 'cue-reformat-buffer)

(provide 'cue-mode)
;;; cue-mode.el ends here

0 comments on commit 1bec9d9

Please sign in to comment.