Skip to content

Commit

Permalink
better toggle of electric mode and update surgested
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsen committed Aug 14, 2008
1 parent 81af86b commit 0fe82d1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
10 changes: 7 additions & 3 deletions scala-electric.el
Expand Up @@ -65,9 +65,10 @@ closing bracket or not."
(defvar scala-electric-mode-map (make-sparse-keymap)
"Keymap for scala electric minor mode.")

(define-key scala-electric-mode-map "{" 'scala-electric-curlies)
(define-key scala-electric-mode-map "(" 'scala-electric-matching-char)
(define-key scala-electric-mode-map "[" 'scala-electric-matching-char)
(define-key scala-electric-mode-map "{" 'scala-electric-curlies)
(define-key scala-electric-mode-map "(" 'scala-electric-matching-char)
(define-key scala-electric-mode-map "[" 'scala-electric-matching-char)
(define-key scala-electric-mode-map "\"" 'scala-electric-matching-char)

;;;###autoload
(or (assoc 'scala-electric-mode minor-mode-alist)
Expand All @@ -81,6 +82,9 @@ closing bracket or not."

;; Functions

(defun scala-electric-active-p ()
scala-electric-mode)

(defun scala-electric-code-at-point-p()
(and scala-electric-mode
(let* ((properties (text-properties-at (point))))
Expand Down
8 changes: 6 additions & 2 deletions scala-mode.el
Expand Up @@ -18,7 +18,7 @@
(require 'regexp-opt)
(require 'tempo)

(defconst scala-mode-version "0.5_rc2 ($Revision$)")
(defconst scala-mode-version "0.5_rc3 ($Revision$)")
(defconst scala-bug-e-mail "scala@listes.epfl.ch")
(defconst scala-web-url "http://scala-lang.org/")

Expand Down Expand Up @@ -1060,7 +1060,11 @@ When started, run `scala-mode-hook'.
["Evaluate buffer" scala-eval-buffer (scala-interpreter-running-p)]
"---"
("Options"
["Toggle Scala Electric Mode" scala-electric-mode] ;; TODO needs toggle button thing
["Toggle Scala Electric Mode" scala-electric-mode
:style toggle
:help "Toggle on/off the electric insert mode for Scala"
:selected (scala-electric-active-p)
:active t]
)
["Browse Scala Web site..." scala-browse-web-site t]
["Customize..." scala-customize t]
Expand Down

0 comments on commit 0fe82d1

Please sign in to comment.