File: scala-mode-map.el

package info (click to toggle)
scala-mode-el 1%3A1.1.1~git20241231.661337d-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 320 kB
  • sloc: lisp: 2,705; makefile: 47
file content (28 lines) | stat: -rw-r--r-- 1,052 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
;;; scala-mode-map.el - Major mode for editing scala, keyboard map -*- lexical-binding: t -*-
;;; Copyright (c) 2012 Heikki Vesalainen
;;; For information on the License, see the LICENSE file

(require 'scala-mode-indent)

(defvar scala-mode-map
  (let ((map (make-sparse-keymap)))
    (set-keymap-parent map prog-mode-map)
    ;(substitute-key-definition 'delete-indentation 'scala-indent:join-line map global-map)
    map)
  "Local key map used for scala mode")

(defun scala-mode-map:add-self-insert-hooks ()
  (add-hook 'post-self-insert-hook
            'scala-indent:indent-on-parentheses nil t)
  (add-hook 'post-self-insert-hook
            'scala-indent:indent-on-special-words nil t)
  (add-hook 'post-self-insert-hook
            'scala-indent:indent-on-scaladoc-asterisk nil t)
  (add-hook 'post-self-insert-hook
            'scala-indent:fix-scaladoc-close nil t))

(defun scala-mode-map:add-remove-indent-hook ()
  (add-hook 'post-command-hook
            'scala-indent:remove-indent-from-previous-empty-line))

(provide 'scala-mode-map)