Skip to content

Commit

Permalink
fixed some compilation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hvesalai committed Sep 29, 2019
1 parent 2a7b0fd commit 44772cb
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ SOURCE_DIR = $(ROOT)
##############################################################################
# Variables

MODE_NAME = scala-mode2
MODE_NAME = scala-mode

# Emacs Lisp
ELISP_COMMAND ?= emacs
Expand All @@ -28,9 +28,10 @@ ELISP_FILES += $(MODE_NAME)
ELISP_FILES += $(MODE_NAME)-syntax
ELISP_FILES += $(MODE_NAME)-indent
ELISP_FILES += $(MODE_NAME)-paragraph
ELISP_FILES += $(MODE_NAME)-prettify-symbols
ELISP_FILES += $(MODE_NAME)-imenu
ELISP_FILES += $(MODE_NAME)-fontlock
ELISP_FILES += $(MODE_NAME)-map
ELISP_FILES += $(MODE_NAME)-sbt
ELISP_SOURCES += $(ELISP_FILES:%=$(SOURCE_DIR)/%.el)

PKG_FILE += $(SOURCE_DIR)/$(MODE_NAME)-pkg.el
Expand Down Expand Up @@ -75,7 +76,6 @@ package:
cp $(ELISP_SOURCES) $(PKG_FILE) $(MODE_NAME_VERSION)
tar cf $(MODE_NAME_VERSION).tar $(MODE_NAME_VERSION)


## SCALA LICENSE
##
## Copyright (c) 2002-2011 EPFL, Lausanne, unless otherwise specified.
Expand Down
13 changes: 10 additions & 3 deletions scala-mode-imenu.el
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@
(setq lexical-binding t)

(defcustom scala-imenu:should-flatten-index t
"Controls whether or not the imenu index is flattened or hierarchical.")
"Controls whether or not the imenu index is flattened or hierarchical."
:type 'boolean
:safe #'booleanp
:group 'scala)
(defcustom scala-imenu:build-imenu-candidate
'scala-imenu:default-build-imenu-candidate
"Controls whether or not the imenu index has definition type information.")
"Controls whether or not the imenu index has definition type information."
:type 'function
:group 'scala)
(defcustom scala-imenu:cleanup-hooks nil
"Functions that will be run after the construction of each imenu")
"Functions that will be run after the construction of each imenu"
:type 'hook
:group 'scala)

(defun scala-imenu:flatten-list (incoming-list &optional predicate)
(when (not predicate) (setq predicate 'listp))
Expand Down
8 changes: 4 additions & 4 deletions scala-mode-indent.el
Original file line number Diff line number Diff line change
Expand Up @@ -863,12 +863,12 @@ comment is outside the comment region. "
Indents the line if position is right after a space that is after
a word that needs to be indented specially."
;; magic numbers used 4 = length of "case"
;; magic numbers used 4 = length of "case", 7 = length of "finally"
(when (and (> (current-column) 4)
(= (char-before) ?\s)
(= (char-syntax (char-before (- (point) 1))) ?w)
(save-excursion (backward-char)
(looking-back scala-indent:indent-on-words-re))
(looking-back scala-indent:indent-on-words-re 7))
(not (nth 8 (syntax-ppss))))
(scala-indent:indent-line-to (scala-indent:calculate-indent-for-line))))

Expand Down Expand Up @@ -954,10 +954,10 @@ of a line inside a multi-line comment "
(looking-at " *\\*\\($\\|[^/]\\)")
(save-excursion (goto-char (max (nth 8 state) (line-beginning-position)))
(looking-at "\\s */?\\*")))
(delete-forward-char 2))
(delete-char 2))
((and (nth 4 state) ; row comment (i.e. with //)
(looking-at " //"))
(delete-forward-char 3))))
(delete-char 3))))
(scala-indent:fixup-whitespace)))

(provide 'scala-mode-indent)
2 changes: 1 addition & 1 deletion scala-mode-syntax.el
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ not. A list must be either enclosed in parentheses or start with

(defun scala-syntax:forward-sexp-or-next-line ()
(interactive)
(cond ((looking-at "\n") (next-line) (beginning-of-line))
(cond ((looking-at "\n") (forward-line 1) (beginning-of-line))
(t (forward-sexp))))

(defun scala-syntax:beginning-of-definition ()
Expand Down
3 changes: 3 additions & 0 deletions scala-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
(require 'scala-mode-imenu)
(require 'scala-mode-prettify-symbols)

(defvar fixup-whitespace) ;; for compilation
(defvar delete-indentation) ;; for compilation

;; Tested only for emacs 24
(unless (<= 24 emacs-major-version)
(error
Expand Down

0 comments on commit 44772cb

Please sign in to comment.