branch: elpa/julia-mode commit 7eb90389f56c6f1b7da7f929e973b1364d42b48e Author: Wilfred Hughes <m...@wilfred.me.uk> Commit: Yichao Yu <yyc1...@gmail.com>
Highlight the function name, not the module name, in declarations. For example, the code: function Base.getindex{T,S}(x::ArraySplit{T,S,Nothing}, i::Int) (i >= 1 && i <= x.k) || throw(BoundsError()) copy!(x.buf, 1, x.s, (i-1)*(x.n-x.noverlap) + 1, x.n) end --- julia-mode.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index bcfd170..b21378c 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -105,7 +105,12 @@ ].* \\(in\\)\\(\\s-\\|$\\)+") (defconst julia-function-regex - (rx symbol-start "function" (1+ space) (group (1+ (or word ?_ ?!))))) + (rx symbol-start "function" + (1+ space) + ;; Don't highlight module names in function declarations: + (* (seq (1+ (or word ?_)) ".")) + ;; The function name itself + (group (1+ (or word ?_ ?!))))) (defconst julia-type-regex (rx symbol-start (or "immutable" "type" "abstract") (1+ space) (group (1+ (or word ?_)))))