summaryrefslogtreecommitdiff
path: root/scala-mode-lib.el
blob: 538f3a0255292f3ed13d47aad8552ae7cca56fb5 (plain)
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
;;; scala-mode-lib.el - Major mode for editing scala, common functions
;;; Copyright (c) 2012 Heikki Vesalainen
;;; For information on the License, see the LICENSE file

(defvar scala-mode:debug-messages
  "If true, some debug messages may be printed printed."
  nil)

(defmacro scala-lib:column-after (&rest body)
  `(save-excursion
     ,@body
     (current-column)))

(defmacro scala-lib:point-after (&rest body)
  `(save-excursion
     ,@body
     (point)))

(defun scala-lib:delete-trailing-whitespace ()
  (save-excursion
    (end-of-line)
    (skip-syntax-backward " ")
    (unless (bolp)
      (delete-char (- (line-end-position) (point))))))

(provide 'scala-mode-lib)