Skip to content

Commit

Permalink
Merge pull request JuliaLang#10361 from Wilfred/silence_emacs_byte_co…
Browse files Browse the repository at this point in the history
…mpile_warnings

Silence Emacs byte-compilation warnings.
  • Loading branch information
kmsquire committed Mar 15, 2015
2 parents 76e8f3d + 3589972 commit 075ed8f
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 075ed8f

Please sign in to comment.