branch: elpa/julia-mode
commit 13a3c5387e98b3f2d21f6daa53bdbb4219b1ca99
Merge: 505d71b a4eeb6c
Author: Tamas K. Papp <tkp...@gmail.com>
Commit: GitHub <nore...@github.com>

    Merge branch 'master' into triple-quote-cmd
---
 julia-mode-tests.el | 6 ++++++
 julia-mode.el       | 8 +++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/julia-mode-tests.el b/julia-mode-tests.el
index 7ef8292..94d46bb 100644
--- a/julia-mode-tests.el
+++ b/julia-mode-tests.el
@@ -582,6 +582,12 @@ end")
     (julia--should-font-lock s4 10 font-lock-string-face)
     (julia--should-font-lock s4 14 nil)))
 
+(ert-deftest julia--test-ccall-font-lock ()
+  (let ((s1 "t = ccall(:clock, Int32, ())"))
+    (julia--should-font-lock s1 5 font-lock-builtin-face)
+    (julia--should-font-lock s1 4 nil)
+    (julia--should-font-lock s1 10 nil)))
+
 ;;; Movement
 (ert-deftest julia--test-beginning-of-defun-assn-1 ()
   "Point moves to beginning of single-line assignment function."
diff --git a/julia-mode.el b/julia-mode.el
index 3cdc217..dedf966 100644
--- a/julia-mode.el
+++ b/julia-mode.el
@@ -247,7 +247,7 @@
 (defconst julia-keyword-regex
   (regexp-opt
    '("if" "else" "elseif" "while" "for" "begin" "end" "quote"
-     "try" "catch" "return" "local" "function" "macro" "ccall"
+     "try" "catch" "return" "local" "function" "macro"
      "finally" "break" "continue" "global" "where"
      "module" "using" "import" "export" "const" "let" "do"
      "baremodule"
@@ -272,9 +272,11 @@
    (cons julia-macro-regex ''julia-macro-face)
    (cons
     (regexp-opt
-     '("true" "false" "C_NULL" "Inf" "NaN" "Inf32" "NaN32" "nothing" "undef" 
"missing")
+     ;; constants defined in Core plus true/false
+     '("true" "false" "Cvoid" "Inf" "NaN" "Inf32" "NaN32" "nothing" "undef" 
"missing")
      'symbols)
     'font-lock-constant-face)
+   (cons "ccall" 'font-lock-builtin-face)
    (list julia-unquote-regex 2 'font-lock-constant-face)
    (list julia-forloop-in-regex 1 'font-lock-keyword-face)
    (list julia--forloop-=-regex 1 'font-lock-keyword-face)
@@ -794,7 +796,7 @@ strings."
 ;; (add-hook 'julia-mode-hook 'julia-math-mode)
 ;; (add-hook 'inferior-julia-mode-hook 'julia-math-mode)
 
-(when (require 'latex nil t)
+(when (featurep 'latex)
   (declare-function LaTeX-math-abbrev-prefix "latex")
 
   (defun julia-math-insert (s)

Reply via email to