Skip to content

Commit

Permalink
Silence Emacs byte-compilation warnings.
Browse files Browse the repository at this point in the history
Solves the issue raised in JuliaLang#10303.
  • Loading branch information
Wilfred committed Feb 28, 2015
1 parent 34bb0b6 commit 3589972
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions contrib/julia-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@

;;; Code:

(require 'cl) ;; incf, decf, plusp
;; We can't use cl-lib whilst supporting Emacs 23 users who don't use
;; ELPA.
(with-no-warnings
(require 'cl)) ;; incf, decf, plusp

(defvar julia-mode-hook nil)

Expand Down Expand Up @@ -412,20 +415,20 @@ before point. Returns nil if we're not within nested parens."
(when (>= point-offset 0)
(move-to-column (+ (current-indentation) point-offset)))))

(defmacro julia--should-indent (from to)
"Assert that we indent text FROM producing text TO in `julia-mode'."
`(with-temp-buffer
(julia-mode)
(insert ,from)
(indent-region (point-min) (point-max))
(should (equal (buffer-substring-no-properties (point-min) (point-max))
,to))))

;; Emacs 23.X doesn't include ert, so we ignore any errors that occur
;; when we define tests.
(ignore-errors
(require 'ert)

(defmacro julia--should-indent (from to)
"Assert that we indent text FROM producing text TO in `julia-mode'."
`(with-temp-buffer
(julia-mode)
(insert ,from)
(indent-region (point-min) (point-max))
(should (equal (buffer-substring-no-properties (point-min) (point-max))
,to))))

(ert-deftest julia--test-indent-if ()
"We should indent inside if bodies."
(julia--should-indent
Expand Down

0 comments on commit 3589972

Please sign in to comment.