[nongnu] elpa/julia-mode c982fd6 216/352: Changed name of Emacs buffer to *Julia*
branch: elpa/julia-mode commit c982fd6b0b9065adf8ac36657fcae9895965cf2b Author: Philip Woods Commit: Yichao Yu Changed name of Emacs buffer to *Julia* --- julia-mode.el | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index 7507c7a..86aeff5 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -3131,10 +3131,10 @@ end")) "Run an inferior instance of `julia' inside Emacs." (interactive) (let ((julia-program julia-program) - (buffer (get-buffer-create "Julia"))) - (when (not (comint-check-proc "Julia")) -(apply #'make-comint-in-buffer "Julia" "Julia" julia-program julia-arguments)) - (pop-to-buffer-same-window "Julia") + (buffer (get-buffer-create "*Julia*"))) + (when (not (comint-check-proc "*Julia*")) +(apply #'make-comint-in-buffer "Julia" "*Julia*" julia-program julia-arguments)) + (pop-to-buffer-same-window "*Julia*") (inferior-julia-mode))) (defun inferior-julia--initialize ()
[nongnu] elpa/julia-mode 5ee867e 211/352: Changed inferior-julia function in contrib/julia-mode.el to apply
branch: elpa/julia-mode commit 5ee867e2318bd290492f88605e522895b29d065d Author: Philip Woods Commit: Yichao Yu Changed inferior-julia function in contrib/julia-mode.el to apply make-comint-in-buffer instead of calling function directly --- julia-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index 6f52ff8..a206929 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -3114,7 +3114,7 @@ end")) (let ((julia-program julia-file-path) (buffer (get-buffer-create "Julia"))) (when (not (comint-check-proc "Julia")) -(make-comint-in-buffer "Julia" "Julia" julia-program julia-arguments)) +(apply #'make-comint-in-buffer "Julia" "Julia" julia-program julia-arguments)) (pop-to-buffer-same-window "Julia") (inferior-julia-mode)))
[nongnu] elpa/julia-mode 6f075d7 224/352: Use syntax-propertize-function on Emacs 24.
branch: elpa/julia-mode commit 6f075d72acde25d2a7598e022ae52610868c6fa7 Author: Wilfred Hughes Commit: Yichao Yu Use syntax-propertize-function on Emacs 24. Fixes https://github.com/JuliaLang/julia/issues/11591 --- julia-mode.el | 79 +++ 1 file changed, 58 insertions(+), 21 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index 368b5ce..7cf2f56 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -111,16 +111,17 @@ This function provides equivalent functionality, but makes no efforts to optimis table) "Syntax table for `julia-mode'.") -(defconst julia-char-regex - (rx (or (any "-" ";" "\\" "^" "!" "|" "?" "*" "<" "%" "," "=" ">" "+" "/" "&" "$" "~" ":") - (syntax open-parenthesis) - (syntax whitespace) - bol) - (group "'") - (group - (or (repeat 0 8 (not (any "'"))) (not (any "\\")) - "")) - (group "'"))) +(eval-when-compile + (defconst julia-char-regex +(rx (or (any "-" ";" "\\" "^" "!" "|" "?" "*" "<" "%" "," "=" ">" "+" "/" "&" "$" "~" ":") +(syntax open-parenthesis) +(syntax whitespace) +bol) +(group "'") +(group + (or (repeat 0 8 (not (any "'"))) (not (any "\\")) + "")) +(group "'" (defconst julia-triple-quoted-string-regex ;; We deliberately put a group on the first and last delimiter, so @@ -254,6 +255,38 @@ This function provides equivalent functionality, but makes no efforts to optimis (defconst julia-block-end-keywords (list "end" "else" "elseif" "catch" "finally")) +(defun julia-stringify-triple-quote () + "Put `syntax-table' property on triple-quoted string delimeters. + +Based on `python-syntax-stringify'." + (let* ((string-start-pos (- (point) 3)) + (string-end-pos (point)) + (ppss (prog2 + (backward-char 3) + (syntax-ppss) + (forward-char 3))) + (in-comment (nth 4 ppss)) + (in-string (nth 8 ppss))) +(unless in-comment + (if in-string + ;; We're in a string, so this must be the closing triple-quote. + ;; Put | on the last " character. + (put-text-property (1- string-end-pos) string-end-pos + 'syntax-table (string-to-syntax "|")) +;; We're not in a string, so this is the opening triple-quote. +;; Put | on the first " character. +(put-text-property string-start-pos (1+ string-start-pos) + 'syntax-table (string-to-syntax "|")) + +(defconst julia-syntax-propertize-function + (syntax-propertize-rules + ("\"\"\"" +(0 (ignore (julia-stringify-triple-quote + (julia-char-regex +(1 "\"") ; Treat ' as a string delimiter. +(2 ".") ; Don't highlight anything between. +(3 "\"" ; Treat the last " in """ as a string delimiter. + (defun julia-in-comment () "Return non-nil if point is inside a comment. Handles both single-line and multi-line comments." @@ -605,17 +638,21 @@ c")) (set (make-local-variable 'comment-start) "# ") (set (make-local-variable 'comment-start-skip) "#+\\s-*") (set (make-local-variable 'font-lock-defaults) '(julia-font-lock-keywords)) - (set (make-local-variable 'font-lock-syntactic-keywords) - (list -`(,julia-char-regex - (1 "\"") ; Treat ' as a string delimiter. - (2 ".") ; Don't highlight anything between the open and close '. - (3 "\"")); Treat the close ' as a string delimiter. -`(,julia-triple-quoted-string-regex - (1 "\"") ; Treat the first " in """ as a string delimiter. - (2 ".") ; Don't highlight anything between. - (3 "\"")) ; Treat the last " in """ as a string delimiter. - )) + (if (< emacs-major-version 24) + ;; Emacs 23 doesn't have syntax-propertize-function + (set (make-local-variable 'font-lock-syntactic-keywords) + (list +`(,julia-char-regex + (1 "\"") ; Treat ' as a string delimiter. + (2 ".") ; Don't highlight anything between the open and close '. + (3 "\"")); Treat the close ' as a string delimiter. +`(,julia-triple-quoted-string-regex + (1 "\"") ; Treat the first " in """ as a string delimiter. + (2 ".") ; Don't highlight anything between. + (3 "\"" ; Treat the last " in """ as a string delimiter. +;; Emacs 24 and later has syntax-propertize-function, so use that instead. +(set (make-local-variable 'syntax-propertize-function) + julia-syntax-propertize-function)) (set (make-local-variable 'indent-line-function) 'julia-indent-line) (set (make-local-variable 'julia-basic-offset) 4) (setq indent-tabs-mode nil)
[nongnu] elpa/julia-mode 856e45d 096/352: long-needed update to type names in julia-mode
branch: elpa/julia-mode commit 856e45dec963bae848c51d340af14b50bd3646fc Author: Jeff Bezanson Commit: Yichao Yu long-needed update to type names in julia-mode --- julia-mode.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index ea0bc54..517e3fa 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -60,7 +60,7 @@ "for +.*[^ ].* \\(in\\)\\(\\s-\\|$\\)+") (defconst julia-font-lock-keywords - (list '("\\<\\(\\|Uint\\(8\\|16\\|32\\|64\\)\\|Int\\(8\\|16\\|32\\|64\\)\\|Integer\\|Float\\|Float32\\|Float64\\|Complex128\\|Complex64\\|ComplexNum\\|Bool\\|Char\\|Number\\|Scalar\\|Real\\|Int\\|Uint\\|Array\\|DArray\\|AbstractArray\\|AbstractVector\\|AbstractMatrix\\|SubArray\\|StridedArray\\|StridedVector\\|StridedMatrix\\|VecOrMat\\|StridedVecOrMat\\|Range\\|Range1\\|SparseMatrixCSC\\|Tuple\\|NTuple\\|Buffer\\|Size\\|Index\\|Symbol\\|Function\\|Vector\\|Matrix\\|Union\\|Type\\|Any\ [...] + (list '("\\<\\(\\|Uint\\(8\\|16\\|32\\|64\\|128\\)\\|Int\\(8\\|16\\|32\\|64\\|128\\)\\|Integer\\|Float\\|Float32\\|Float64\\|Complex128\\|Complex64\\|ComplexPair\\|Bool\\|Char\\|Number\\|Real\\|Int\\|Uint\\|Array\\|DArray\\|AbstractArray\\|AbstractVector\\|AbstractMatrix\\|SubArray\\|StridedArray\\|StridedVector\\|StridedMatrix\\|VecOrMat\\|StridedVecOrMat\\|Range\\|Range1\\|SparseMatrixCSC\\|Tuple\\|NTuple\\|Symbol\\|Function\\|Vector\\|Matrix\\|Union\\|Type\\|Any\\|Complex\\|None\\|S [...] font-lock-type-face) (cons (concat "\\<\\(" @@ -72,7 +72,7 @@ "module" "import" "export" "const" "let" "bitstype" "do") "\\|") "\\)\\>") 'font-lock-keyword-face) -'("\\<\\(true\\|false\\|C_NULL\\|Inf\\|NaN\\|Inf32\\|NaN32\\)\\>" . font-lock-constant-face) + '("\\<\\(true\\|false\\|C_NULL\\|Inf\\|NaN\\|Inf32\\|NaN32\\|nothing\\)\\>" . font-lock-constant-face) (list julia-unquote-regex 2 'font-lock-constant-face) (list julia-char-regex 2 'font-lock-string-face) (list julia-forloop-in-regex 1 'font-lock-keyword-face)
[nongnu] elpa/nasm-mode 64e450d 54/67: Allow inserting tabs immediately after a mnemonic
branch: elpa/nasm-mode commit 64e450d3c6c29f50368d53309d7cc96bd2f47423 Author: Charlie Green Commit: Christopher Wellons Allow inserting tabs immediately after a mnemonic This required a change to `nasm-indent-line'. --- nasm-mode.el | 36 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/nasm-mode.el b/nasm-mode.el index 6f8e68a..9753218 100644 --- a/nasm-mode.el +++ b/nasm-mode.el @@ -594,19 +594,31 @@ (nasm-indent-line)) (defun nasm-indent-line () - "Indent current line as NASM assembly code." + "Indent current line (or insert a tab) as NASM assembly code. +This will be called by `indent-for-tab-command' when TAB is +pressed. We indent the entire line as appropriate whenever POINT +is not immediately after a mnemonic; otherwise, we insert a tab." (interactive) - (let ((orig (- (point-max) (point -(back-to-indentation) -(if (or (looking-at (nasm--opt nasm-directives)) -(looking-at (nasm--opt nasm-pp-directives)) -(looking-at "\\[") -(looking-at ";;+") -(looking-at nasm-label-regexp)) -(indent-line-to 0) - (indent-line-to nasm-basic-offset)) -(when (> (- (point-max) orig) (point)) - (goto-char (- (point-max) orig) + (let ((before ; text before point and after indentation + (save-excursion + (let ((point (point)) + (bti (progn (back-to-indentation) (point + (buffer-substring-no-properties bti point) +(if (member before nasm-instructions) +;; We are immediately after an instruction, just insert a tab +(insert "\t") + ;; We're literally anywhere else, indent the whole line + (let ((orig (- (point-max) (point +(back-to-indentation) +(if (or (looking-at (nasm--opt nasm-directives)) +(looking-at (nasm--opt nasm-pp-directives)) +(looking-at "\\[") +(looking-at ";;+") +(looking-at nasm-label-regexp)) +(indent-line-to 0) + (indent-line-to nasm-basic-offset)) +(when (> (- (point-max) orig) (point)) + (setf (point) (- (point-max) orig))) (defun nasm--current-line () "Return the current line as a string."
[nongnu] elpa/julia-mode d239cdf 072/352: fixing #319. the vast majority of ' and " uses will be highlighted correctly.
branch: elpa/julia-mode commit d239cdf0f1becfefc9bbe90b42abba3c6e29d725 Author: Jeff Bezanson Commit: Yichao Yu fixing #319. the vast majority of ' and " uses will be highlighted correctly. the problem we gain instead is that \ is an escape character even outside quotes, so `\"` will fail to start a string. But this character sequence is easy to avoid, since on the slim chance you need to divide a string, you can just add a space. --- julia-mode.el | 31 +-- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index 8a6fb78..bf93b37 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -18,8 +18,9 @@ (modify-syntax-entry ?\] ")[ " table) (modify-syntax-entry ?\( "() " table) (modify-syntax-entry ?\) ")( " table) -(modify-syntax-entry ?\\ "." table) ; \ is an operator outside quotes -(modify-syntax-entry ?' "w" table) ; character quote, ignored for now +;(modify-syntax-entry ?\\ "." table) ; \ is an operator outside quotes +(modify-syntax-entry ?' "." table) ; character quote or transpose +;(modify-syntax-entry ?\" "." table) (modify-syntax-entry ?? "." table) (modify-syntax-entry ?$ "." table) (modify-syntax-entry ?& "." table) @@ -33,12 +34,25 @@ table) "Syntax table for julia-mode") -; syntax table that holds within strings (uses default emacs behavior) +;; syntax table that holds within strings (defvar julia-mode-string-syntax-table (let ((table (make-syntax-table))) table) "Syntax table for julia-mode") +;; disable " inside char quote +(defvar julia-mode-char-syntax-table + (let ((table (make-syntax-table))) +(modify-syntax-entry ?\" "." table) +table) + "Syntax table for julia-mode") + +(defconst julia-string-regex + "\"[^\"]*?\\(\\(\\)*\"[^\"]*?\\)*\"") + +(defconst julia-char-regex + "\\(\\s(\\|\\s-\\|-\\|[,%=<>\\+*/?&|$!\\^~;:]\\|^\\)\\('\\(\\(.*?[^]\\)\\|\\(\\)\\)'\\)") + (defconst julia-font-lock-keywords (list '("\\<\\(true\\|false\\|\\|Uint\\(8\\|16\\|32\\|64\\)\\|Int\\(8\\|16\\|32\\|64\\)\\|Integer\\|Float\\|Float32\\|Float64\\|Complex128\\|Complex64\\|ComplexNum\\|Bool\\|Char\\|Number\\|Scalar\\|Real\\|Int\\|Uint\\|Array\\|DArray\\|AbstractArray\\|AbstractVector\\|AbstractMatrix\\|SubArray\\|StridedArray\\|StridedVector\\|StridedMatrix\\|VecOrMat\\|StridedVecOrMat\\|Range\\|Range1\\|SparseMatrixCSC\\|Tuple\\|NTuple\\|Buffer\\|Size\\|Index\\|Symbol\\|Function\\|Vector\\|Matrix\\|Unio [...] font-lock-type-face) @@ -52,7 +66,9 @@ "module" "import" "export" "const" "let" "bitstype") "\\|") "\\)\\>") 'font-lock-keyword-face) -'("\\s-*\".*?\"" . font-lock-string-face))) +(list julia-char-regex 2 'font-lock-string-face) +;(list julia-string-regex 0 'font-lock-string-face) +)) (defconst julia-block-start-keywords (list "if" "while" "for" "begin" "try" "function" "type" "let" "macro" @@ -210,8 +226,11 @@ ; (list "\\(\\)\\s-*\".*?\"" 1 julia-mode-char-syntax-table))) (set (make-local-variable 'font-lock-syntactic-keywords) (list -(list "\\(\"\\(.\\|\\s-\\)*?[^]\"\\|\"\"\\)" 0 - julia-mode-string-syntax-table))) + (list julia-char-regex 2 + julia-mode-char-syntax-table) +;(list julia-string-regex 0 +; julia-mode-string-syntax-table) +)) (set (make-local-variable 'indent-line-function) 'julia-indent-line) (set (make-local-variable 'julia-basic-offset) 4) (setq indent-tabs-mode nil)
[nongnu] elpa/nasm-mode 3992726 42/67: Add nasm-join-line keybinding (M-^).
branch: elpa/nasm-mode commit 3992726a6da49379cb2939d46e0b95a7781d8c06 Author: Christopher Wellons Commit: Christopher Wellons Add nasm-join-line keybinding (M-^). --- nasm-mode.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nasm-mode.el b/nasm-mode.el index b6d9d74..188f9a0 100644 --- a/nasm-mode.el +++ b/nasm-mode.el @@ -566,7 +566,8 @@ (let ((map (make-sparse-keymap))) (prog1 map (define-key map (kbd ":") #'nasm-colon) - (define-key map (kbd ";") #'nasm-comment))) + (define-key map (kbd ";") #'nasm-comment) + (define-key map (kbd "M-^") #'nasm-join-line))) "Key bindings for `nasm-mode'.") (defun nasm-colon ()
[nongnu] elpa/julia-mode 716d58c 217/352: Added autoload cookie to inferior-julia function in contrib/julia-mode.el
branch: elpa/julia-mode commit 716d58c3f21ec710d804148bdf9dabfa52c81c86 Author: Philip Woods Commit: Yichao Yu Added autoload cookie to inferior-julia function in contrib/julia-mode.el --- julia-mode.el | 1 + 1 file changed, 1 insertion(+) diff --git a/julia-mode.el b/julia-mode.el index 86aeff5..ce413e1 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -3127,6 +3127,7 @@ end")) map) "Basic mode map for `inferior-julia-mode'.") +;;;###autoload (defun inferior-julia () "Run an inferior instance of `julia' inside Emacs." (interactive)
[nongnu] elpa/nasm-mode f53b2c5 56/67: Create a formal TODO list
branch: elpa/nasm-mode commit f53b2c5d2358a6bc19dc5157f022c635e3deab2e Author: Christopher Wellons Commit: Christopher Wellons Create a formal TODO list --- nasm-mode.el | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nasm-mode.el b/nasm-mode.el index 9191e89..9d17658 100644 --- a/nasm-mode.el +++ b/nasm-mode.el @@ -25,7 +25,10 @@ ;; http://www.nasm.us/doc/nasmdocb.html ;; TODO: -;; * Line continuation awareness +;; [ ] Line continuation awareness +;; [ ] Don't run comment command if type ';' inside a string +;; [ ] Nice multi-; comments, like in asm-mode +;; [x] Be able to hit tab after typing mnemonic and insert a TAB ;;; Code:
[nongnu] elpa/julia-mode db9a18c 102/352: .mailmap: some additions to dedup contributors in gitlog
branch: elpa/julia-mode commit db9a18cb15d0555c538f72d7bd1601a884867bc7 Author: Stefan Karpinski Commit: Yichao Yu .mailmap: some additions to dedup contributors in gitlog --- .mailmap | 13 + 1 file changed, 13 insertions(+) diff --git a/.mailmap b/.mailmap index ad73fbb..8cc5f4d 100644 --- a/.mailmap +++ b/.mailmap @@ -73,3 +73,16 @@ Westley Argentum Hennigh George V. Neville-Neil George V. Neville-Neil + +Alessandro Andrioni Silva +Alessandro Andrioni Silva + +Toivo Henningsson +Toivo Henningsson + +Adam Savitzky +Adam Savitzky + +David Slate + +Francois Pepin
[nongnu] elpa/julia-mode b1e02f1 230/352: rename: FloatingPoint => AbstractFloat
branch: elpa/julia-mode commit b1e02f1dddf7072839a5078b6758dabe4a692e90 Author: Stefan Karpinski Commit: Yichao Yu rename: FloatingPoint => AbstractFloat --- julia-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index 0c30e25..8a779d7 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -209,7 +209,7 @@ This function provides equivalent functionality, but makes no efforts to optimis '("Number" "Real" "BigInt" "Integer" "UInt" "UInt8" "UInt16" "UInt32" "UInt64" "UInt128" "Int" "Int8" "Int16" "Int32" "Int64" "Int128" - "BigFloat" "FloatingPoint" "Float16" "Float32" "Float64" + "BigFloat" "AbstractFloat" "Float16" "Float32" "Float64" "Complex128" "Complex64" "Bool" "Cuchar" "Cshort" "Cushort" "Cint" "Cuint" "Clonglong" "Culonglong" "Cintmax_t" "Cuintmax_t"
[nongnu] elpa/nasm-mode 65ca654 67/67: make comment functions local
branch: elpa/nasm-mode commit 65ca6546fc395711fac5b3b4299e76c2303d43a8 Author: nverno Commit: nverno make comment functions local --- nasm-mode.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nasm-mode.el b/nasm-mode.el index 842d347..307e871 100644 --- a/nasm-mode.el +++ b/nasm-mode.el @@ -746,6 +746,8 @@ With a prefix arg, kill the comment on the current line with :group 'nasm-mode (make-local-variable 'indent-line-function) (make-local-variable 'comment-start) + (make-local-variable 'comment-insert-comment-function) + (make-local-variable 'comment-indent-function) (setf font-lock-defaults '(nasm-font-lock-keywords nil :case-fold) indent-line-function #'nasm-indent-line comment-start ";"
[nongnu] elpa/julia-mode 7064885 113/352: update mailmap
branch: elpa/julia-mode commit 7064885588ec44fa73f925a6ea419359ff9f11d2 Author: Viral B. Shah Commit: Yichao Yu update mailmap --- .mailmap | 6 ++ 1 file changed, 6 insertions(+) diff --git a/.mailmap b/.mailmap index 5662907..7700ba1 100644 --- a/.mailmap +++ b/.mailmap @@ -94,3 +94,9 @@ Steven G. Johnson Isaiah Norton Isaiah Norton + +Blake Johnson +Blake Johnson + +Marcus Silva +Marcus Silva
[nongnu] elpa/julia-mode 2d860b1 248/352: Merge pull request #18 from JuliaLang/yyc/str-cleanup
branch: elpa/julia-mode commit 2d860b18582e6423de271500530a390469f93294 Merge: 4f72dfa 2486d1e Author: Yichao Yu Commit: Yichao Yu Merge pull request #18 from JuliaLang/yyc/str-cleanup Replace {UTF8,ASCII,Byte}String with String --- julia-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index e9a2c0c..abc7c4e 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -280,7 +280,7 @@ This function provides equivalent functionality, but makes no efforts to optimis "Cuchar" "Cshort" "Cushort" "Cint" "Cuint" "Clonglong" "Culonglong" "Cintmax_t" "Cuintmax_t" "Cfloat" "Cdouble" "Cptrdiff_t" "Cssize_t" "Csize_t" "Cchar" "Clong" "Culong" "Cwchar_t" - "Char" "ASCIIString" "UTF8String" "ByteString" "SubString" + "Char" "String" "SubString" "Array" "DArray" "AbstractArray" "AbstractVector" "AbstractMatrix" "AbstractSparseMatrix" "SubArray" "StridedArray" "StridedVector" "StridedMatrix" "VecOrMat" "StridedVecOrMat" "DenseArray" "SparseMatrixCSC" "BitArray" "Range" "OrdinalRange" "StepRange" "UnitRange" "FloatRange" "Tuple" "NTuple" "Vararg"
[nongnu] elpa/julia-mode 5762e13 133/352: remove * and div for Char
branch: elpa/julia-mode commit 5762e13bfbbcafda4e3f00b8e033dd449483c58e Author: Jeff Bezanson Commit: Yichao Yu remove * and div for Char export UnitRange NEWS for range changes remove random test for BigInt ranges, since they now have BigInt lengths, for which we can't yet generate random numbers. --- julia-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index 6341928..119530b 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -77,7 +77,7 @@ ].* \\(in\\)\\(\\s-\\|$\\)+") (defconst julia-font-lock-keywords - (list '("\\<\\(\\|Uint\\(8\\|16\\|32\\|64\\|128\\)\\|Int\\(8\\|16\\|32\\|64\\|128\\)\\|BigInt\\|Integer\\|BigFloat\\|FloatingPoint\\|Float16\\|Float32\\|Float64\\|Complex128\\|Complex64\\|ComplexPair\\|Bool\\|Char\\|DataType\\|Number\\|Real\\|Int\\|Uint\\|Array\\|DArray\\|AbstractArray\\|AbstractVector\\|AbstractMatrix\\|AbstractSparseMatrix\\|SubArray\\|StridedArray\\|StridedVector\\|StridedMatrix\\|VecOrMat\\|StridedVecOrMat\\|DenseArray\\|Range\\|Range1\\|SparseMatrixCSC\\|Tuple\\|N [...] + (list '("\\<\\(\\|Uint\\(8\\|16\\|32\\|64\\|128\\)\\|Int\\(8\\|16\\|32\\|64\\|128\\)\\|BigInt\\|Integer\\|BigFloat\\|FloatingPoint\\|Float16\\|Float32\\|Float64\\|Complex128\\|Complex64\\|ComplexPair\\|Bool\\|Char\\|DataType\\|Number\\|Real\\|Int\\|Uint\\|Array\\|DArray\\|AbstractArray\\|AbstractVector\\|AbstractMatrix\\|AbstractSparseMatrix\\|SubArray\\|StridedArray\\|StridedVector\\|StridedMatrix\\|VecOrMat\\|StridedVecOrMat\\|DenseArray\\|Range\\|OrdinalRange\\|StepRange\\|UnitRange [...] font-lock-type-face) (cons (concat "\\<\\("
[nongnu] elpa/julia-mode 3fe9882 114/352: Add emacs mode usage
branch: elpa/julia-mode commit 3fe9882e84f7748ace0bbdd605796f2a89882891 Author: Dan Luu Commit: Yichao Yu Add emacs mode usage --- julia-mode.el | 8 1 file changed, 8 insertions(+) diff --git a/julia-mode.el b/julia-mode.el index 3e6932e..4f28a0f 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -2,6 +2,14 @@ ; Emacs mode for Julia ; +; USAGE +; = + +; Put the following code in your .emacs, site-load.el, or other relevant file +; (load "path-to-julia-mode/julia-mode.el") +; (require 'julia-mode) + + (defvar julia-mode-hook nil) (add-to-list 'auto-mode-alist '("\\.jl\\'" . julia-mode))
[nongnu] elpa/julia-mode 84d9a19 147/352: Fix emacs highlighting of symbols that contain keywords.
branch: elpa/julia-mode commit 84d9a19e360f53e7d5970ad0df436ff6bbcc2ce3 Author: Wilfred Hughes Commit: Yichao Yu Fix emacs highlighting of symbols that contain keywords. Previously, symbols such as `prepend!` or `net_required_for` incorrectly had `end` and `for` highlighted. --- julia-mode.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index 503f045..bd2456a 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -94,7 +94,8 @@ "try" "catch" "return" "local" "abstract" "function" "macro" "ccall" "finally" "typealias" "break" "continue" "type" "global" "module" "using" "import" "export" "const" "let" "bitstype" "do" - "baremodule" "importall" "immutable"))) + "baremodule" "importall" "immutable") + 'symbols)) (defconst julia-font-lock-keywords (list
[nongnu] elpa/julia-mode 3913d39 117/352: Add BigInt and BigFloat to julia-mode.el
branch: elpa/julia-mode commit 3913d392f96aa3836f84e7e08abc924b8f1d90ad Author: Viral B. Shah Commit: Yichao Yu Add BigInt and BigFloat to julia-mode.el --- julia-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index f0d1f8a..4b24125 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -69,7 +69,7 @@ ].* \\(in\\)\\(\\s-\\|$\\)+") (defconst julia-font-lock-keywords - (list '("\\<\\(\\|Uint\\(8\\|16\\|32\\|64\\|128\\)\\|Int\\(8\\|16\\|32\\|64\\|128\\)\\|Integer\\|FloatingPoint\\|Float32\\|Float64\\|Complex128\\|Complex64\\|ComplexPair\\|Bool\\|Char\\|Number\\|Real\\|Int\\|Uint\\|Array\\|DArray\\|AbstractArray\\|AbstractVector\\|AbstractMatrix\\|AbstractSparseMatrix\\|SubArray\\|StridedArray\\|StridedVector\\|StridedMatrix\\|VecOrMat\\|StridedVecOrMat\\|Range\\|Range1\\|SparseMatrixCSC\\|Tuple\\|NTuple\\|Symbol\\|Function\\|Vector\\|Matrix\\|Union\\| [...] + (list '("\\<\\(\\|Uint\\(8\\|16\\|32\\|64\\|128\\)\\|Int\\(8\\|16\\|32\\|64\\|128\\)\\|BigInt\\|Integer\\|BigFloat\\|FloatingPoint\\|Float32\\|Float64\\|Complex128\\|Complex64\\|ComplexPair\\|Bool\\|Char\\|Number\\|Real\\|Int\\|Uint\\|Array\\|DArray\\|AbstractArray\\|AbstractVector\\|AbstractMatrix\\|AbstractSparseMatrix\\|SubArray\\|StridedArray\\|StridedVector\\|StridedMatrix\\|VecOrMat\\|StridedVecOrMat\\|Range\\|Range1\\|SparseMatrixCSC\\|Tuple\\|NTuple\\|Symbol\\|Function\\|Vector [...] font-lock-type-face) (cons (concat "\\<\\("
[nongnu] elpa/julia-mode fc04731 153/352: Highlight parameter types and subtypes.
branch: elpa/julia-mode commit fc047312eec2a0e75c908b2fffa88a1aa9a77838 Author: Wilfred Hughes Commit: Yichao Yu Highlight parameter types and subtypes. --- julia-mode.el | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index 3d65664..ef22798 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -108,13 +108,16 @@ (rx symbol-start "function" (1+ space) (group (1+ (or word ?_ ?!) (defconst julia-type-regex - (rx symbol-start "type" (1+ space) (group (1+ (or word ?_) + (rx symbol-start (or "function" "type" "abstract") (1+ space) (group (1+ (or word ?_) (defconst julia-type-annotation-regex (rx "::" (group (1+ (or word ?_) +(defconst julia-type-parameter-regex + (rx symbol-start (1+ (or word ?_)) "{" (group (1+ (or word ?_))) "}")) + (defconst julia-subtype-regex - (rx "<:" (1+ space) (group (1+ (or word ?_) + (rx "<:" (1+ space) (group (1+ (or word ?_))) (0+ space) (or "\n" "{" "end"))) (defconst julia-macro-regex "@\\w+") @@ -144,6 +147,7 @@ (list julia-function-regex 1 'font-lock-function-name-face) (list julia-type-regex 1 'font-lock-type-face) (list julia-type-annotation-regex 1 'font-lock-type-face) +(list julia-type-parameter-regex 1 'font-lock-type-face) (list julia-subtype-regex 1 'font-lock-type-face) ))
[nongnu] elpa/julia-mode 267cebf 118/352: Autoload julia-mode.
branch: elpa/julia-mode commit 267cebfb0870506fc4ec7814ab7a69c7f314da95 Author: George Ogata Commit: Yichao Yu Autoload julia-mode. --- julia-mode.el | 1 + 1 file changed, 1 insertion(+) diff --git a/julia-mode.el b/julia-mode.el index 4b24125..c168057 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -222,6 +222,7 @@ (when (julia-at-keyword julia-block-end-keywords) (forward-word 1))) +;;;###autoload (defun julia-mode () "Major mode for editing julia code" (interactive)
[nongnu] elpa/julia-mode 646f758 156/352: Don't skip over end keywords.
branch: elpa/julia-mode commit 646f758cee41a76f8c3990751a7b4c8dbf67dcb1 Author: Wilfred Hughes Commit: Yichao Yu Don't skip over end keywords. --- julia-mode.el | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index 8121aea..dc1f961 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -286,9 +286,7 @@ Do not move back beyond MIN." ;; Point is now at the beginning of indentation, restore it ;; to its original position (relative to indentation). (when (>= point-offset 0) - (move-to-column (+ (current-indentation) point-offset))) -(when (julia-at-keyword julia-block-end-keywords) - (forward-word 1 + (move-to-column (+ (current-indentation) point-offset) (defalias 'julia-mode-prog-mode (if (fboundp 'prog-mode)
[nongnu] elpa/julia-mode 81e46b1 129/352: Update cjh in .mailmap
branch: elpa/julia-mode commit 81e46b1c7e111cd71c57e9697047fd8a8a21fb76 Author: Jiahao Chen Commit: Yichao Yu Update cjh in .mailmap --- .mailmap | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.mailmap b/.mailmap index 6597ab3..e459929 100644 --- a/.mailmap +++ b/.mailmap @@ -32,6 +32,8 @@ Stephan Boyer Stephan Boyer Stephan Boyer +Jiahao Chen Jiahao Chen (陈家豪) + Giuseppe Zingales Giuseppe Zingales
[nongnu] elpa/julia-mode d7a7607 184/352: Make julia-last-open-block-pos a pure function that only returns the position.
branch: elpa/julia-mode commit d7a76075508e2e445ef9440c28c774cc27cd038d Author: Wilfred Hughes Commit: Yichao Yu Make julia-last-open-block-pos a pure function that only returns the position. --- julia-mode.el | 30 -- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index cac3f03..7dfc292 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -295,21 +295,23 @@ a keyword if used as a field name, X.word, or quoted, :word." (ignore-errors (backward-char (defun julia-last-open-block-pos (min) - "Move back and return the position of the last open block, if one found. + "Return the position of the last open block, if one found. Do not move back beyond position MIN." - (let ((count 0)) -(while (not (or (> count 0) (<= (point) min))) - (julia-safe-backward-sexp) - (setq count - (cond ((julia-at-keyword julia-block-start-keywords) - (+ count 1)) - ((and (equal (current-word t) "end") - (not (julia-in-comment)) (not (julia-in-brackets))) - (- count 1)) - (t count -(if (> count 0) - (point) - nil))) + (save-excursion +(let ((count 0)) + (while (not (or (> count 0) (<= (point) min))) +(julia-safe-backward-sexp) +(setq count + (cond ((julia-at-keyword julia-block-start-keywords) + (+ count 1)) +;; fixme: breaks on strings +((and (equal (current-word t) "end") + (not (julia-in-comment)) (not (julia-in-brackets))) + (- count 1)) +(t count + (if (> count 0) + (point) +nil (defun julia-last-open-block (min) "Move back and return indentation level for last open block.
[nongnu] elpa/julia-mode b829e08 131/352: Added DataType to the list of highlighted type words in julia-mode.el.
branch: elpa/julia-mode commit b829e0836bdf68e362411372c010bf0b4cab0e89 Author: Patrick Egan Foley Commit: Yichao Yu Added DataType to the list of highlighted type words in julia-mode.el. --- julia-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index 3502285..f8e6e2a 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -77,7 +77,7 @@ ].* \\(in\\)\\(\\s-\\|$\\)+") (defconst julia-font-lock-keywords - (list '("\\<\\(\\|Uint\\(8\\|16\\|32\\|64\\|128\\)\\|Int\\(8\\|16\\|32\\|64\\|128\\)\\|BigInt\\|Integer\\|BigFloat\\|FloatingPoint\\|Float16\\|Float32\\|Float64\\|Complex128\\|Complex64\\|ComplexPair\\|Bool\\|Char\\|Number\\|Real\\|Int\\|Uint\\|Array\\|DArray\\|AbstractArray\\|AbstractVector\\|AbstractMatrix\\|AbstractSparseMatrix\\|SubArray\\|StridedArray\\|StridedVector\\|StridedMatrix\\|VecOrMat\\|StridedVecOrMat\\|StoredArray\\|DenseArray\\|Range\\|Range1\\|SparseMatrixCSC\\|Tuple\ [...] + (list '("\\<\\(\\|Uint\\(8\\|16\\|32\\|64\\|128\\)\\|Int\\(8\\|16\\|32\\|64\\|128\\)\\|BigInt\\|Integer\\|BigFloat\\|FloatingPoint\\|Float16\\|Float32\\|Float64\\|Complex128\\|Complex64\\|ComplexPair\\|Bool\\|Char\\|DataType\\|Number\\|Real\\|Int\\|Uint\\|Array\\|DArray\\|AbstractArray\\|AbstractVector\\|AbstractMatrix\\|AbstractSparseMatrix\\|SubArray\\|StridedArray\\|StridedVector\\|StridedMatrix\\|VecOrMat\\|StridedVecOrMat\\|StoredArray\\|DenseArray\\|Range\\|Range1\\|SparseMatrixC [...] font-lock-type-face) (cons (concat "\\<\\("
[nongnu] elpa/julia-mode 9dd8281 134/352: Add support for multiline comments
branch: elpa/julia-mode commit 9dd8281c3f39081615c8c265b58e4ce31abd7ae3 Author: Ron Rock Commit: Yichao Yu Add support for multiline comments I'm unclear about the purpose of the `b` flag, but it seems to work --- julia-mode.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index 119530b..a66c092 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -24,7 +24,8 @@ (modify-syntax-entry ?_ "w" table) ; underscores in words (modify-syntax-entry ?@ "w" table) (modify-syntax-entry ?. "_" table) -(modify-syntax-entry ?# "<" table) ; # single-line comment start +(modify-syntax-entry ?# "< 14" table) ; # single-line and multiline start +(modify-syntax-entry ?= ". 23bn" table) (modify-syntax-entry ?\n ">" table) ; \n single-line comment end (modify-syntax-entry ?\{ "(} " table) (modify-syntax-entry ?\} "){ " table) @@ -45,7 +46,6 @@ (modify-syntax-entry ?- "." table) (modify-syntax-entry ?< "." table) (modify-syntax-entry ?> "." table) -(modify-syntax-entry ?= "." table) (modify-syntax-entry ?% "." table) table) "Syntax table for `julia-mode'.")
[nongnu] elpa/julia-mode 40c5e82 185/352: Fix indentation when we're indenting a line that has an open paren after point.
branch: elpa/julia-mode commit 40c5e82f07861b2e877ea2c52368eab85a117269 Author: Wilfred Hughes Commit: Yichao Yu Fix indentation when we're indenting a line that has an open paren after point. --- julia-mode.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index 7dfc292..d0881e1 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -353,10 +353,12 @@ before point. Returns nil if we're not within nested parens." (indent-line-to (or ;; If we're inside an open paren, indent to line up arguments. - (ignore-errors (julia-paren-indent)) ;; If we're on a block end keyword, unindent. (save-excursion (beginning-of-line) +(ignore-errors (julia-paren-indent))) + (save-excursion +(beginning-of-line) (forward-to-indentation 0) (let ((endtok (julia-at-keyword julia-block-end-keywords))) (ignore-errors (+ (julia-last-open-block (point-min))
[nongnu] elpa/julia-mode 65cfc0d 201/352: julia-mode.el: add a bunch of builtin types
branch: elpa/julia-mode commit 65cfc0d2bbaafb33806670483b8f777860a0df0a Author: Rafael Fourquet Commit: Yichao Yu julia-mode.el: add a bunch of builtin types --- julia-mode.el | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index 0ce07b4..5f54d68 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -198,11 +198,16 @@ This function provides equivalent functionality, but makes no efforts to optimis "BigFloat" "FloatingPoint" "Float16" "Float32" "Float64" "Complex128" "Complex64" "ComplexPair" "Bool" + "Cuchar" "Cshort" "Cushort" "Cint" "Cuint" "Clonglong" "Culonglong" "Cintmax_t" "Cuintmax_t" + "Cfloat" "Cdouble" "Cptrdiff_t" "Cssize_t" "Csize_t" + "Cchar" "Clong" "Culong" "Cwchar_t" "Char" "ASCIIString" "UTF8String" "ByteString" "SubString" - "Array" "DArray" "AbstractArray" "AbstractVector" "AbstractMatrix" "AbstractSparseMatrix" "SubArray" "StridedArray" "StridedVector" "StridedMatrix" "VecOrMat" "StridedVecOrMat" "DenseArray" "SparseMatrixCSC" + "Array" "DArray" "AbstractArray" "AbstractVector" "AbstractMatrix" "AbstractSparseMatrix" "SubArray" "StridedArray" "StridedVector" "StridedMatrix" "VecOrMat" "StridedVecOrMat" "DenseArray" "SparseMatrixCSC" "BitArray" "Range" "Range1" "OrdinalRange" "StepRange" "UnitRange" "FloatRange" "Tuple" "NTuple" - "DataType" "Symbol" "Function" "Vector" "Matrix" "Union" "Type" "Any" "Complex" "None" "String" "Ptr" "Void" "Exception" "Task" "Signed" "Unsigned" "Associative" "Dict" "IO" "IOStream" "Ranges" "Rational" "Regex" "RegexMatch" "Set" "IntSet" "Expr" "WeakRef" "Nothing" "ObjectIdDict") + "DataType" "Symbol" "Function" "Vector" "Matrix" "Union" "Type" "Any" "Complex" "None" "String" "Ptr" "Void" "Exception" "Task" "Signed" "Unsigned" "Associative" "Dict" "IO" "IOStream" "Ranges" "Rational" "Regex" "RegexMatch" "Set" "IntSet" "Expr" "WeakRef" "Nothing" "ObjectIdDict" + "AbstractRNG" "MersenneTwister" + ) 'symbols)) (defconst julia-quoted-symbol-regex @@ -271,7 +276,7 @@ As a result, it is true inside \"foo\", `foo` and 'f'." (incf open-count)) (when (looking-at (rx "]")) (decf open-count))) - + (forward-char 1))) ;; If we've opened more than we've closed, we're inside brackets.
[nongnu] elpa/julia-mode c924bd0 128/352: update SGJ mailmap entries
branch: elpa/julia-mode commit c924bd06081a1524ab4e7d0590c04b2e39fe8d4d Author: Steven G. Johnson Commit: Yichao Yu update SGJ mailmap entries --- .mailmap | 4 1 file changed, 4 insertions(+) diff --git a/.mailmap b/.mailmap index 9453498..6597ab3 100644 --- a/.mailmap +++ b/.mailmap @@ -91,6 +91,10 @@ Francois Pepin Waldir Pimenta Steven G. Johnson +Steven G. Johnson +Steven G. Johnson +Steven G. Johnson +Steven G. Johnson Isaiah Norton Isaiah Norton
[nongnu] elpa/julia-mode c74045a 125/352: emacs mode: change underscores back to word characters
branch: elpa/julia-mode commit c74045ad7855cb45de4c4b2c9a079e23d8e9cf5e Author: Jeff Bezanson Commit: Yichao Yu emacs mode: change underscores back to word characters --- julia-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index 6cfdfd9..f537952 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -21,7 +21,7 @@ (defvar julia-mode-syntax-table (let ((table (make-syntax-table))) -(modify-syntax-entry ?_ "_" table) ; underscores in words +(modify-syntax-entry ?_ "w" table) ; underscores in words (modify-syntax-entry ?@ "_" table) (modify-syntax-entry ?. "_" table) (modify-syntax-entry ?# "<" table) ; # single-line comment start
[nongnu] elpa/julia-mode 96499ff 209/352: Silence Emacs byte-compilation warnings.
branch: elpa/julia-mode commit 96499ff031f67174a474fcc91b6b3574667bdd07 Author: Wilfred Hughes Commit: Yichao Yu Silence Emacs byte-compilation warnings. Solves the issue raised in JuliaLang/julia#10303. --- julia-mode.el | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index d3d5a2a..9b10370 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -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) @@ -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
[nongnu] elpa/julia-mode 109747e 132/352: eliminate StoredArray (fix #6212, #987); UniformScaling is no longer an AbstractArray (#5810)
branch: elpa/julia-mode commit 109747e6a88f747e4f86124f66b41a10727eaabe Author: Steven G. Johnson Commit: Yichao Yu eliminate StoredArray (fix #6212, #987); UniformScaling is no longer an AbstractArray (#5810) --- julia-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index f8e6e2a..6341928 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -77,7 +77,7 @@ ].* \\(in\\)\\(\\s-\\|$\\)+") (defconst julia-font-lock-keywords - (list '("\\<\\(\\|Uint\\(8\\|16\\|32\\|64\\|128\\)\\|Int\\(8\\|16\\|32\\|64\\|128\\)\\|BigInt\\|Integer\\|BigFloat\\|FloatingPoint\\|Float16\\|Float32\\|Float64\\|Complex128\\|Complex64\\|ComplexPair\\|Bool\\|Char\\|DataType\\|Number\\|Real\\|Int\\|Uint\\|Array\\|DArray\\|AbstractArray\\|AbstractVector\\|AbstractMatrix\\|AbstractSparseMatrix\\|SubArray\\|StridedArray\\|StridedVector\\|StridedMatrix\\|VecOrMat\\|StridedVecOrMat\\|StoredArray\\|DenseArray\\|Range\\|Range1\\|SparseMatrixC [...] + (list '("\\<\\(\\|Uint\\(8\\|16\\|32\\|64\\|128\\)\\|Int\\(8\\|16\\|32\\|64\\|128\\)\\|BigInt\\|Integer\\|BigFloat\\|FloatingPoint\\|Float16\\|Float32\\|Float64\\|Complex128\\|Complex64\\|ComplexPair\\|Bool\\|Char\\|DataType\\|Number\\|Real\\|Int\\|Uint\\|Array\\|DArray\\|AbstractArray\\|AbstractVector\\|AbstractMatrix\\|AbstractSparseMatrix\\|SubArray\\|StridedArray\\|StridedVector\\|StridedMatrix\\|VecOrMat\\|StridedVecOrMat\\|DenseArray\\|Range\\|Range1\\|SparseMatrixCSC\\|Tuple\\|N [...] font-lock-type-face) (cons (concat "\\<\\("
[nongnu] elpa/julia-mode 6781ef1 220/352: Fix #11673, bad indent after comments ending in =
branch: elpa/julia-mode commit 6781ef19d499bd9ec4e98e6159291f3cb7ff18d1 Author: Dan Schmidt Commit: Yichao Yu Fix #11673, bad indent after comments ending in = --- julia-mode.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index 43f97b5..407c8b6 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -396,7 +396,8 @@ before point. Returns nil if we're not within nested parens." (progn (forward-line -1) (end-of-line) (backward-char 1) - (equal (char-after (point)) ?=))) + (and (equal (char-after (point)) ?=) + (not (julia-in-comment) (+ julia-basic-offset (current-indentation)) nil))) ;; Indent according to how many nested blocks we are in.
[nongnu] elpa/julia-mode 70d6482 160/352: `throw` and `error` are built-in functions that we should highlight.
branch: elpa/julia-mode commit 70d6482755d5eee480b1ee67ce5acfda1ea9b7a5 Author: Wilfred Hughes Commit: Yichao Yu `throw` and `error` are built-in functions that we should highlight. --- julia-mode.el | 6 ++ 1 file changed, 6 insertions(+) diff --git a/julia-mode.el b/julia-mode.el index 724b6db..bcfd170 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -131,6 +131,11 @@ "baremodule" "importall" "immutable") 'symbols)) +(defconst julia-builtin-regex + (regexp-opt + '("error" "throw") + 'symbols)) + (defconst julia-font-lock-keywords (list '("\\<\\(\\|Uint\\(8\\|16\\|32\\|64\\|128\\)\\|Int\\(8\\|16\\|32\\|64\\|128\\)\\|BigInt\\|Integer\\|BigFloat\\|FloatingPoint\\|Float16\\|Float32\\|Float64\\|Complex128\\|Complex64\\|ComplexPair\\|Bool\\|Char\\|DataType\\|Number\\|Real\\|Int\\|Uint\\|Array\\|DArray\\|AbstractArray\\|AbstractVector\\|AbstractMatrix\\|AbstractSparseMatrix\\|SubArray\\|StridedArray\\|StridedVector\\|StridedMatrix\\|VecOrMat\\|StridedVecOrMat\\|DenseArray\\|Range\\|OrdinalRange\\|StepRange\\|UnitRange\\|Fl [...] @@ -150,6 +155,7 @@ (list julia-type-annotation-regex 1 'font-lock-type-face) (list julia-type-parameter-regex 1 'font-lock-type-face) (list julia-subtype-regex 1 'font-lock-type-face) +(list julia-builtin-regex 1 'font-lock-builtin-face) )) (defconst julia-block-start-keywords
[nongnu] elpa/julia-mode 0526f2f 242/352: Fix spelling of 'delimiter'
branch: elpa/julia-mode commit 0526f2fead72852ae7f9018f88e8546347aaee76 Author: Graham Inggs Commit: Yichao Yu Fix spelling of 'delimiter' --- julia-mode.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index 47b6108..4e41075 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -100,7 +100,7 @@ This function provides equivalent functionality, but makes no efforts to optimis (modify-syntax-entry ?\) ")( " table) ;; Here, we treat ' as punctuation (when it's used for transpose), ;; see our use of `julia-char-regex' for handling ' as a character -;; delimeter +;; delimiter (modify-syntax-entry ?' "." table) (modify-syntax-entry ?\" "\"" table) (modify-syntax-entry ?` "\"" table) @@ -333,7 +333,7 @@ This function provides equivalent functionality, but makes no efforts to optimis (list "end" "else" "elseif" "catch" "finally")) (defun julia-stringify-triple-quote () - "Put `syntax-table' property on triple-quoted string delimeters. + "Put `syntax-table' property on triple-quoted string delimiters. Based on `python-syntax-stringify'." (let* ((string-start-pos (- (point) 3))
[nongnu] elpa/julia-mode 7eb9038 161/352: Highlight the function name, not the module name, in declarations.
branch: elpa/julia-mode commit 7eb90389f56c6f1b7da7f929e973b1364d42b48e Author: Wilfred Hughes Commit: Yichao Yu 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 ?_)
[nongnu] elpa/julia-mode 2b15d76 256/352: bol
branch: elpa/julia-mode commit 2b15d768afcba972b54abe52902736cf0d769725 Author: nverno Commit: nverno bol --- julia-mode-tests.el | 15 +++ julia-mode.el | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/julia-mode-tests.el b/julia-mode-tests.el index 61d1d31..92c4568 100644 --- a/julia-mode-tests.el +++ b/julia-mode-tests.el @@ -54,6 +54,16 @@ (should (equal (buffer-substring-no-properties (point-min) (point-max)) ,to) +(defmacro julia--should-font-lock (text pos face) + "Assert that TEXT at position POS gets font-locked with FACE in `julia-mode'." + `(with-temp-buffer + (julia-mode) + (insert ,text) + (if (fboundp 'font-lock-ensure) + (font-lock-ensure (point-min) (point-max)) + (with-no-warnings + (font-lock-fontify-buffer))) + (should (eq ,face (get-text-property ,pos 'face) (ert-deftest julia--test-indent-if () "We should indent inside if bodies." @@ -350,6 +360,11 @@ using Foo: bar , quux notpartofit")) +(ert-deftest julia--test-symbol-font-locking-at-bol () + "Symbols get font-locked at beginning or line." + (julia--should-font-lock + ":a in keys(Dict(:a=>1))" 1 'julia-quoted-symbol-face)) + (defun julia--run-tests () (interactive) (if (featurep 'ert) diff --git a/julia-mode.el b/julia-mode.el index 09c302f..6f204d1 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -291,7 +291,7 @@ This function provides equivalent functionality, but makes no efforts to optimis (defconst julia-quoted-symbol-regex ;; :foo and :foo2 are valid, but :123 is not. - (rx (or whitespace "(" "[" "," "=") + (rx (or bol whitespace "(" "[" "," "=") (group ":" (or letter (syntax symbol)) (0+ (or word (syntax symbol)) (defconst julia-font-lock-keywords
[nongnu] elpa/julia-mode b6b52a4 162/352: tweaks to emacs syntax highlighting
branch: elpa/julia-mode commit b6b52a479b14727bfb59467766db7967653f072e Author: Jeff Bezanson Commit: Yichao Yu tweaks to emacs syntax highlighting - the type-parameter case only affected single type parameters. not worth doing. - coloring only `error` and `throw` differently is too arbitrary. --- julia-mode.el | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index b21378c..ca56595 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -118,8 +118,8 @@ (defconst julia-type-annotation-regex (rx "::" (group (1+ (or word ?_) -(defconst julia-type-parameter-regex - (rx symbol-start (1+ (or word ?_)) "{" (group (1+ (or word ?_))) "}")) +;;(defconst julia-type-parameter-regex +;; (rx symbol-start (1+ (or word ?_)) "{" (group (1+ (or word ?_))) "}")) (defconst julia-subtype-regex (rx "<:" (1+ space) (group (1+ (or word ?_))) (0+ space) (or "\n" "{" "end"))) @@ -138,7 +138,8 @@ (defconst julia-builtin-regex (regexp-opt - '("error" "throw") + ;;'("error" "throw") + '() 'symbols)) (defconst julia-font-lock-keywords @@ -158,7 +159,7 @@ (list julia-function-regex 1 'font-lock-function-name-face) (list julia-type-regex 1 'font-lock-type-face) (list julia-type-annotation-regex 1 'font-lock-type-face) -(list julia-type-parameter-regex 1 'font-lock-type-face) +;;(list julia-type-parameter-regex 1 'font-lock-type-face) (list julia-subtype-regex 1 'font-lock-type-face) (list julia-builtin-regex 1 'font-lock-builtin-face) ))
[nongnu] elpa/julia-mode 7802452 263/352: Merge pull request #35 from tpapp/fix-10
branch: elpa/julia-mode commit 78024526718479b63fe3804308b65b405a164688 Merge: feb6e79 5812bc3 Author: Jeff Bezanson Commit: GitHub Merge pull request #35 from tpapp/fix-10 Fix indentation for anonymous functions. --- julia-mode-tests.el | 35 +++ julia-mode.el | 1 + 2 files changed, 36 insertions(+) diff --git a/julia-mode-tests.el b/julia-mode-tests.el index 92c4568..e813657 100644 --- a/julia-mode-tests.el +++ b/julia-mode-tests.el @@ -360,6 +360,41 @@ using Foo: bar , quux notpartofit")) +(ert-deftest julia--test-indent-anonymous-function () + "indentation for function(args...)" + (julia--should-indent + "function f(x) +function(y) +x+y +end +end" + "function f(x) +function(y) +x+y +end +end")) + +(ert-deftest julia--test-indent-keyword-paren () + "indentation for ( following keywords" + "if( a>0 ) +end + +function( i=1:2 ) +for( j=1:2 ) +for( k=1:2 ) +end +end +end" + "if( a>0 ) +end + +function( i=1:2 ) +for( j=1:2 ) +for( k=1:2 ) +end +end +end") + (ert-deftest julia--test-symbol-font-locking-at-bol () "Symbols get font-locked at beginning or line." (julia--should-font-lock diff --git a/julia-mode.el b/julia-mode.el index 48cffa5..7b113e4 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -405,6 +405,7 @@ a keyword if used as a field name, X.word, or quoted, :word." (and (or (= (point) 1) (and (not (equal (char-before (point)) ?.)) (not (equal (char-before (point)) ?: + (not (looking-at "(")) ; handle "function(" when on ( (member (current-word t) kw-list) ;; 'end' is not a keyword when used for indexing, e.g. foo[end-2] (or (not (equal (current-word t) "end"))
[nongnu] elpa/julia-mode ac7431c 174/352: Mark @ and ! as a symbol constituents, as suggested by @Clemens-H.
branch: elpa/julia-mode commit ac7431c4a943903ffb179c248dbc4f049e74d6d1 Author: Wilfred Hughes Commit: Yichao Yu Mark @ and ! as a symbol constituents, as suggested by @Clemens-H. Generally only [a-zA-Z0-9] should be word constituents, and everything else should be a symbol constituent. See http://emacs.stackexchange.com/q/1075/304 for a discussion. This also enables us to simplify our regexps. --- julia-mode.el | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index d5e9ad2..c4e3522 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -49,8 +49,9 @@ (defvar julia-mode-syntax-table (let ((table (make-syntax-table))) -(modify-syntax-entry ?_ "w" table) ; underscores in words -(modify-syntax-entry ?@ "w" table) +(modify-syntax-entry ?_ "_" table) +(modify-syntax-entry ?@ "_" table) +(modify-syntax-entry ?! "_" table) (modify-syntax-entry ?# "< 14" table) ; # single-line and multiline start (modify-syntax-entry ?= ". 23bn" table) (modify-syntax-entry ?\n ">" table) ; \n single-line comment end @@ -106,16 +107,16 @@ ].* \\(in\\)\\(\\s-\\|$\\)+") (defconst julia-function-regex - (rx symbol-start "function" + (rx line-start symbol-start "function" (1+ space) ;; Don't highlight module names in function declarations: - (* (seq (1+ (or word ?_)) ".")) + (* (seq (1+ (or word (syntax symbol))) ".")) ;; The function name itself - (group (1+ (or word ?_ ?!) + (group (1+ (or word (syntax symbol)) (defconst julia-function-assignment-regex (rx line-start symbol-start - (group (1+ (or word ?_ ?!))) + (group (1+ (or word (syntax symbol (* space) (? "{" (* (not (any "}"))) "}") (* space) @@ -124,19 +125,19 @@ "=")) (defconst julia-type-regex - (rx symbol-start (or "immutable" "type" "abstract") (1+ space) (group (1+ (or word ?_) + (rx symbol-start (or "immutable" "type" "abstract") (1+ space) (group (1+ (or word (syntax symbol)) (defconst julia-type-annotation-regex - (rx "::" (group (1+ (or word ?_) + (rx "::" (group (1+ (or word (syntax symbol)) ;;(defconst julia-type-parameter-regex -;; (rx symbol-start (1+ (or word ?_)) "{" (group (1+ (or word ?_))) "}")) +;; (rx symbol-start (1+ (or (or word (syntax symbol)) ?_)) "{" (group (1+ (or (or word (syntax symbol)) ?_))) "}")) (defconst julia-subtype-regex - (rx "<:" (1+ space) (group (1+ (or word ?_))) (0+ space) (or "\n" "{" "end"))) + (rx "<:" (1+ space) (group (1+ (or word (syntax symbol (0+ space) (or "\n" "{" "end"))) (defconst julia-macro-regex - (rx symbol-start (group "@" (1+ (or word ?_ ?!) + (rx symbol-start (group "@" (1+ (or word (syntax symbol)) (defconst julia-keyword-regex (regexp-opt
[nongnu] elpa/julia-mode 9c36479 264/352: Merge pull request #36 from JuliaEditorSupport/jb/typekeywords
branch: elpa/julia-mode commit 9c36479c83039c4fc26e583bb1c4dc27de058a4e Merge: 7802452 1332b74 Author: Jeff Bezanson Commit: GitHub Merge pull request #36 from JuliaEditorSupport/jb/typekeywords update for changed type keywords in 0.6 --- julia-mode.el | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index 7b113e4..7842739 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -240,7 +240,9 @@ This function provides equivalent functionality, but makes no efforts to optimis (not (any "=" (defconst julia-type-regex - (rx symbol-start (or "immutable" "type" "abstract") (1+ space) (group (1+ (or word (syntax symbol)) + (rx symbol-start (or "immutable" "type" ;; remove after 0.6 + "abstract type" "primitive type" "struct" "mutable struct") + (1+ space) (group (1+ (or word (syntax symbol)) (defconst julia-type-annotation-regex (rx "::" (0+ space) (group (1+ (or word (syntax symbol)) @@ -257,10 +259,12 @@ This function provides equivalent functionality, but makes no efforts to optimis (defconst julia-keyword-regex (julia--regexp-opt '("if" "else" "elseif" "while" "for" "begin" "end" "quote" - "try" "catch" "return" "local" "abstract" "function" "macro" "ccall" - "finally" "typealias" "break" "continue" "type" "global" - "module" "using" "import" "export" "const" "let" "bitstype" "do" "in" - "baremodule" "importall" "immutable") + "try" "catch" "return" "local" "function" "macro" "ccall" + "finally" "break" "continue" "global" + "module" "using" "import" "export" "const" "let" "do" "in" + "baremodule" "importall" + "immutable" "type" "bitstype" "abstract" "typealias" ;; remove after 0.6 + "abstract type" "primitive type" "struct" "mutable struct") 'symbols)) (defconst julia-builtin-regex @@ -322,8 +326,10 @@ This function provides equivalent functionality, but makes no efforts to optimis )) (defconst julia-block-start-keywords - (list "if" "while" "for" "begin" "try" "function" "type" "let" "macro" -"quote" "do" "immutable" "module")) + (list "if" "while" "for" "begin" "try" "function" "let" "macro" +"quote" "do" "module" +"immutable" "type" ;; remove after 0.6 +"abstract type" "primitive type" "struct" "mutable struct")) ;; For keywords that begin a block without additional indentation (defconst julia-block-start-keywords-no-indent
[nongnu] elpa/julia-mode feb6e79 259/352: Merge pull request #31 from RalphAS/custom-lookback
branch: elpa/julia-mode commit feb6e79dddc8f992f85ae8c955ce024d57ec5e26 Merge: 483805b 4f56ded Author: Yichao Yu Commit: GitHub Merge pull request #31 from RalphAS/custom-lookback make lookback distance customizable --- julia-mode.el | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index 6f204d1..48cffa5 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -479,12 +479,14 @@ beginning of the buffer." (unless (eq (point) (point-min)) (backward-char))) -(defvar julia-max-block-lookback 5000 +(defcustom julia-max-block-lookback 5000 "When indenting, don't look back more than this many characters to see if there are unclosed blocks. This variable has a moderate effect on indent performance if set too -high.") +high, but stops indenting in the middle of long blocks if set too low." + :type 'integer + :group 'julia) (defun julia-paren-indent () "Return the column of the text following the innermost
[nongnu] elpa/julia-mode 747176f 177/352: fix latex symbol \bot
branch: elpa/julia-mode commit 747176f42ce1d55e8c0ee16a0d9c55cbd939cd5b Author: Jeff Bezanson Commit: Yichao Yu fix latex symbol \bot --- julia-mode.el | 1 + 1 file changed, 1 insertion(+) diff --git a/julia-mode.el b/julia-mode.el index d67b028..f32637b 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -1107,6 +1107,7 @@ Do not move back beyond MIN." (puthash "\\vdash" "⊢" julia-latexsubs) (puthash "\\dashv" "⊣" julia-latexsubs) (puthash "\\top" "⊤" julia-latexsubs) +(puthash "\\bot" "⊥" julia-latexsubs) (puthash "\\models" "⊧" julia-latexsubs) (puthash "\\vDash" "⊨" julia-latexsubs) (puthash "\\Vdash" "⊩" julia-latexsubs)
[nongnu] elpa/julia-mode ac22747 178/352: remove trailing ws from repo
branch: elpa/julia-mode commit ac22747835ff10c795da37b1f4727c992eed70ea Author: jake bolewski Commit: Yichao Yu remove trailing ws from repo --- .mailmap | 24 julia-mode.el | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.mailmap b/.mailmap index 772ea45..b833961 100644 --- a/.mailmap +++ b/.mailmap @@ -34,7 +34,7 @@ Stephan Boyer Stephan Boyer Jiahao Chen Jiahao Chen (陈家豪) - + Giuseppe Zingales Giuseppe Zingales @@ -100,17 +100,17 @@ Steven G. Johnson Steven G. Johnson Isaiah Norton -Isaiah Norton +Isaiah Norton Blake Johnson Blake Johnson Marcus Silva -Marcus Silva +Marcus Silva Amit Murthy -Tanmay Mohapatra +Tanmay Mohapatra Tanmay Mohapatra Dan Luu @@ -119,10 +119,10 @@ Dan Luu Kevin Bache Kevin Bache -Rick +Rick Rick -David Smith +David Smith David Smith Carlos Becker @@ -138,16 +138,16 @@ Joseph Perla Jutho Tomas Lycken - -Simon Byrne -Simon Byrne -Jake Bolewski +Simon Byrne +Simon Byrne + +Jake Bolewski Leah Hanson -Lei Wang -Lei Wang +Lei Wang +Lei Wang Kevin Squire diff --git a/julia-mode.el b/julia-mode.el index f32637b..b1cfa67 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -21,10 +21,10 @@ ;; distribute, sublicense, and/or sell copies of the Software, and to ;; permit persons to whom the Software is furnished to do so, subject to ;; the following conditions: -;; +;; ;; The above copyright notice and this permission notice shall be ;; included in all copies or substantial portions of the Software. -;; +;; ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
[nongnu] elpa/julia-mode b99710c 251/352: `python-mode`-like paren-indent
branch: elpa/julia-mode commit b99710cabd77c066a051da6ae1d3a9988d18f491 Author: kshramt Commit: kshramt `python-mode`-like paren-indent --- julia-mode-tests.el | 23 +++ julia-mode.el | 22 +++--- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/julia-mode-tests.el b/julia-mode-tests.el index 647323b..ca6acfc 100644 --- a/julia-mode-tests.el +++ b/julia-mode-tests.el @@ -183,6 +183,29 @@ baz )" foobar( bar, baz )")) +(ert-deftest julia--test-indent-paren-newline () + "python-mode-like indentation." + (julia--should-indent + " +foobar( +bar, +baz)" + " +foobar( +bar, +baz)") + (julia--should-indent + " +foobar( +bar, +baz +)" + " +foobar( +bar, +baz +)")) + (ert-deftest julia--test-indent-equals () "We should increase indent on a trailing =." (julia--should-indent diff --git a/julia-mode.el b/julia-mode.el index abc7c4e..62afa0d 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -468,10 +468,26 @@ with it. Returns nil if we're not within nested parens." ((= (nth 0 parser-state) 0) nil) ;; top level (t (ignore-errors ;; return nil if any of these movements fail - (backward-up-list) - (forward-char) + (beginning-of-line) (skip-syntax-forward " ") - (current-column))) + (let ((possibly-close-paren-point (point))) + (backward-up-list) + (let ((open-paren-point (point))) + (forward-char) + (skip-syntax-forward " ") + (if (eolp) + (progn + (up-list) + (backward-char) + (let ((paren-closed (= (point) possibly-close-paren-point))) + (goto-char open-paren-point) + (beginning-of-line) + (skip-syntax-forward " ") + (+ (current-column) + (if paren-closed + 0 +julia-indent-offset + (current-column)) (defun julia-prev-line-skip-blank-or-comment () "Move point to beginning of previous line skipping blank lines
[nongnu] elpa/julia-mode 76d5d75 183/352: Optimising julia-at-keyword.
branch: elpa/julia-mode commit 76d5d75243840e7edbe1f9761db64b2807d1114e Author: Wilfred Hughes Commit: Yichao Yu Optimising julia-at-keyword. It's an expensive function and we call it quite often. Ensure we do the cheap checks first, and avoid calling julia-in-brackets only if necessary. --- julia-mode.el | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index 7419cfe..cac3f03 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -220,12 +220,6 @@ This function provides equivalent functionality, but makes no efforts to optimis (defconst julia-block-end-keywords (list "end" "else" "elseif" "catch" "finally")) -(defun julia-member (item lst) - (if (null lst) - nil -(or (equal item (car lst)) - (julia-member item (cdr lst) - (defun julia-in-comment () "Return non-nil if point is inside a comment. Handles both single-line and multi-line comments." @@ -289,9 +283,11 @@ a keyword if used as a field name, X.word, or quoted, :word." (and (or (= (point) 1) (and (not (equal (char-before (point)) ?.)) (not (equal (char-before (point)) ?: + (member (current-word t) kw-list) (not (julia-in-comment)) - (not (julia-in-brackets)) - (julia-member (current-word t) kw-list))) + ;; 'end' is not a keyword when used for indexing, e.g. foo[end-2] + (or (not (equal (current-word t) "end")) + (not (julia-in-brackets) ;; if backward-sexp gives an error, move back 1 char to move over the '(' (defun julia-safe-backward-sexp ()
[nongnu] elpa/julia-mode bfa6d83 103/352: major update to modules:
branch: elpa/julia-mode commit bfa6d837b142ca67dc220249eae4c9b55ce2c5b8 Author: Jeff Bezanson Commit: Yichao Yu major update to modules: replace "import M.*" with "using M". import paths are relative to the current module, and search in parent modules as necessary. we are now stricter about name conflicts: once use of a name in a module is resolved, the binding it refers to cannot change. currently the messages are warnings, but can be changed to errors trivially. exporting a name is not sufficient to "resolve" it. fixes the following issues: status: base/ has been ported, sysimg builds, a few tests pass. extras/ not yet touched. a few more imports are probably needed in Base to handle methods added by submodules. --- julia-mode.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index 83a1840..320ed06 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -68,8 +68,8 @@ 'identity '("if" "else" "elseif" "while" "for" "begin" "end" "quote" "try" "catch" "return" "local" "abstract" "function" "macro" "ccall" - "typealias" "break" "continue" "type" "global" "@\\w+" - "module" "import" "export" "const" "let" "bitstype" "do") + "finally" "typealias" "break" "continue" "type" "global" "@\\w+" + "module" "using" "import" "export" "const" "let" "bitstype" "do") "\\|") "\\)\\>") 'font-lock-keyword-face) '("\\<\\(true\\|false\\|C_NULL\\|Inf\\|NaN\\|Inf32\\|NaN32\\|nothing\\)\\>" . font-lock-constant-face)
[nongnu] elpa/julia-mode cb6d4bd 267/352: Fix badge URL
branch: elpa/julia-mode commit cb6d4bd09d648f14ef08cec21ce1ad8b81dc05b3 Author: Wilfred Hughes Commit: GitHub Fix badge URL --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 289195f..b2a7484 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Emacs major mode for the julia programming language -[](https://travis-ci.org/JuliaLang/julia-emacs) +[](https://travis-ci.org/JuliaEditorSupport/julia-emacs) # Install
[nongnu] elpa/julia-mode b24410f 279/352: Allow user to set multiple arguments to inferior julia
branch: elpa/julia-mode commit b24410f30b543fe40500d9130fa3df3710114686 Author: Adam Beckmeyer Commit: Adam Beckmeyer Allow user to set multiple arguments to inferior julia Also fix the call to make-comint-in-buffer so that it's passing the arguments to julia rather than treating the first argument as the STARTFILE. --- julia-mode.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index dba9e38..696fbcb 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -3224,7 +3224,7 @@ strings." (defcustom julia-arguments '() "Commandline arguments to pass to `julia-program'." - :type 'string + :type '(repeat (string :tag "argument")) :group 'julia) (defvar julia-prompt-regexp "^\\w*> " @@ -3244,7 +3244,8 @@ strings." (let ((julia-program julia-program) (buffer (get-buffer-create "*Julia*"))) (when (not (comint-check-proc "*Julia*")) -(apply #'make-comint-in-buffer "Julia" "*Julia*" julia-program julia-arguments)) +(apply #'make-comint-in-buffer "Julia" "*Julia*" + julia-program nil julia-arguments)) (pop-to-buffer-same-window "*Julia*") (inferior-julia-mode)))
[nongnu] elpa/julia-mode 2316ad7 093/352: implement "do" block syntax. closes #441
branch: elpa/julia-mode commit 2316ad74e94e58b22514c1c86b8b797ea28e8695 Author: Jeff Bezanson Commit: Yichao Yu implement "do" block syntax. closes #441 foo(a,b) do x,y # ... end is syntax for foo((x,y)->begin # ... end, a,b) --- julia-mode.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index 1f239d5..bd1bfc1 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -69,7 +69,7 @@ '("if" "else" "elseif" "while" "for" "begin" "end" "quote" "try" "catch" "return" "local" "abstract" "function" "macro" "ccall" "typealias" "break" "continue" "type" "global" "@\\w+" - "module" "import" "export" "const" "let" "bitstype") + "module" "import" "export" "const" "let" "bitstype" "do") "\\|") "\\)\\>") 'font-lock-keyword-face) '("\\<\\(true\\|false\\|C_NULL\\|Inf\\|NaN\\|Inf32\\|NaN32\\)\\>" . font-lock-constant-face) @@ -81,7 +81,7 @@ (defconst julia-block-start-keywords (list "if" "while" "for" "begin" "try" "function" "type" "let" "macro" - "quote")) + "quote" "do")) (defconst julia-block-other-keywords (list "else" "elseif"))
[nongnu] elpa/julia-mode 4f72dfa 246/352: Merge pull request #13 from JuliaLang/keywords_in_comments
branch: elpa/julia-mode commit 4f72dfa5af900212299133170ddefb45ebfafef4 Merge: e4b3428 8818ede Author: Yichao Yu Commit: Yichao Yu Merge pull request #13 from JuliaLang/keywords_in_comments fix ignoring of keywords inside comments --- julia-mode-tests.el | 8 julia-mode.el | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/julia-mode-tests.el b/julia-mode-tests.el index bd57f17..647323b 100644 --- a/julia-mode-tests.el +++ b/julia-mode-tests.el @@ -284,6 +284,14 @@ end" end end")) +(ert-deftest julia--test-indent-after-commented-keyword () + "Ignore keywords in comments when indenting." + (julia--should-indent + "# if foo +a = 1" + "# if foo +a = 1")) + (defun julia--run-tests () (interactive) (if (featurep 'ert) diff --git a/julia-mode.el b/julia-mode.el index 4e41075..e9a2c0c 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -408,8 +408,8 @@ a keyword if used as a field name, X.word, or quoted, :word." (member (current-word t) kw-list) ;; 'end' is not a keyword when used for indexing, e.g. foo[end-2] (or (not (equal (current-word t) "end")) - (not (julia-in-brackets)) - (not (julia-in-comment) + (not (julia-in-brackets))) + (not (julia-in-comment ;; if backward-sexp gives an error, move back 1 char to move over the '(' (defun julia-safe-backward-sexp ()
[nongnu] elpa/julia-mode e5f8145 191/352: Use a separate face for Julia macro invocations.
branch: elpa/julia-mode commit e5f81457431e0f237c5062ba7278f6bc5da71c34 Author: Wilfred Hughes Commit: Yichao Yu Use a separate face for Julia macro invocations. Fixes https://github.com/JuliaLang/julia/issues/8721 --- julia-mode.el | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index 0d71c08..5cd6a08 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -41,6 +41,12 @@ (defvar julia-basic-offset) +(defface julia-macro-face + '((t :inherit font-lock-preprocessor-face)) + "Face for Julia macro invocations." + :group 'julia-mode) + + ;;;###autoload (add-to-list 'auto-mode-alist '("\\.jl\\'" . julia-mode)) @@ -195,7 +201,7 @@ This function provides equivalent functionality, but makes no efforts to optimis (list (cons julia-builtin-types-regex 'font-lock-type-face) (cons julia-keyword-regex 'font-lock-keyword-face) - (cons julia-macro-regex 'font-lock-keyword-face) + (cons julia-macro-regex ''julia-macro-face) (cons (julia--regexp-opt '("true" "false" "C_NULL" "Inf" "NaN" "Inf32" "NaN32" "nothing")
[nongnu] elpa/julia-mode b58ccd0 104/352: Begin work on sparse unary operators.
branch: elpa/julia-mode commit b58ccd07f73c8411e9f04f6d340f548461a86884 Author: Viral B. Shah Commit: Yichao Yu Begin work on sparse unary operators. Introduce AbstractSparseMatrix. --- julia-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index 320ed06..c4e1b44 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -60,7 +60,7 @@ "for +.*[^ ].* \\(in\\)\\(\\s-\\|$\\)+") (defconst julia-font-lock-keywords - (list '("\\<\\(\\|Uint\\(8\\|16\\|32\\|64\\|128\\)\\|Int\\(8\\|16\\|32\\|64\\|128\\)\\|Integer\\|Float\\|Float32\\|Float64\\|Complex128\\|Complex64\\|ComplexPair\\|Bool\\|Char\\|Number\\|Real\\|Int\\|Uint\\|Array\\|DArray\\|AbstractArray\\|AbstractVector\\|AbstractMatrix\\|SubArray\\|StridedArray\\|StridedVector\\|StridedMatrix\\|VecOrMat\\|StridedVecOrMat\\|Range\\|Range1\\|SparseMatrixCSC\\|Tuple\\|NTuple\\|Symbol\\|Function\\|Vector\\|Matrix\\|Union\\|Type\\|Any\\|Complex\\|None\\|S [...] + (list '("\\<\\(\\|Uint\\(8\\|16\\|32\\|64\\|128\\)\\|Int\\(8\\|16\\|32\\|64\\|128\\)\\|Integer\\|Float\\|Float32\\|Float64\\|Complex128\\|Complex64\\|ComplexPair\\|Bool\\|Char\\|Number\\|Real\\|Int\\|Uint\\|Array\\|DArray\\|AbstractArray\\|AbstractVector\\|AbstractMatrix\\|AbstractSparseMatrix\\|SubArray\\|StridedArray\\|StridedVector\\|StridedMatrix\\|VecOrMat\\|StridedVecOrMat\\|Range\\|Range1\\|SparseMatrixCSC\\|Tuple\\|NTuple\\|Symbol\\|Function\\|Vector\\|Matrix\\|Union\\|Type\\|A [...] font-lock-type-face) (cons (concat "\\<\\("
[nongnu] elpa/julia-mode 0f064b7 280/352: Enable color in inferior julia
branch: elpa/julia-mode commit 0f064b756a342354cefea8b6bb25c17b182aef68 Author: Adam Beckmeyer Commit: Adam Beckmeyer Enable color in inferior julia Also explicitly pass the "-i" flag for interactivity. --- julia-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index 696fbcb..f88632f 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -3222,7 +3222,7 @@ strings." :type 'string :group 'julia) -(defcustom julia-arguments '() +(defcustom julia-arguments '("-i" "--color=yes") "Commandline arguments to pass to `julia-program'." :type '(repeat (string :tag "argument")) :group 'julia)
[nongnu] elpa/julia-mode 493fb7f 192/352: note #8947 in julia-mode.el
branch: elpa/julia-mode commit 493fb7fe21660f8bf7a9e856a849f9d1b1cb55d0 Author: Steven G. Johnson Commit: Yichao Yu note #8947 in julia-mode.el --- julia-mode.el | 1 + 1 file changed, 1 insertion(+) diff --git a/julia-mode.el b/julia-mode.el index 5cd6a08..3b6f030 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -489,6 +489,7 @@ before point. Returns nil if we're not within nested parens." ;println("(puthash \"$ks\" \"$vs\" julia-latexsubs)") ;end ;end +; (See Julia issue #8947 for why we don't use the Emacs tex input mode.) (puthash "\\textexclamdown" "¡" julia-latexsubs) (puthash "\\sterling" "£" julia-latexsubs) (puthash "\\yen" "¥" julia-latexsubs)
[nongnu] elpa/julia-mode 3597e9a 186/352: Comment improvements.
branch: elpa/julia-mode commit 3597e9af7bec251beee2dfdbbd8d30e17226d018 Author: Wilfred Hughes Commit: Yichao Yu Comment improvements. --- julia-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index d0881e1..3715793 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -353,10 +353,10 @@ before point. Returns nil if we're not within nested parens." (indent-line-to (or ;; If we're inside an open paren, indent to line up arguments. - ;; If we're on a block end keyword, unindent. (save-excursion (beginning-of-line) (ignore-errors (julia-paren-indent))) + ;; Indent according to how many nested blocks we are in. (save-excursion (beginning-of-line) (forward-to-indentation 0)
[nongnu] elpa/julia-mode 88aab43 121/352: Merge in changes from ESS' version of julia-mode.el
branch: elpa/julia-mode commit 88aab43107fe139146e5dfc93b0607e67c59428a Author: Stephen J. Eglen Commit: Yichao Yu Merge in changes from ESS' version of julia-mode.el Update syntax entries to use "_" syntax class. Docstrings added, conforming to `checkdoc'. Replace error2nil macro with the equivalent builtin ignore-errors macro. Derive the major mode from prog-mode. Add imenu support (see "Imenu" menubar item.) --- julia-mode.el | 103 +++--- 1 file changed, 63 insertions(+), 40 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index c9391cd..9eee5a3 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -16,8 +16,9 @@ (defvar julia-mode-syntax-table (let ((table (make-syntax-table))) -(modify-syntax-entry ?_ "w" table) ; underscores in words -(modify-syntax-entry ?@ "w" table) +(modify-syntax-entry ?_ "_" table) ; underscores in words +(modify-syntax-entry ?@ "_" table) +(modify-syntax-entry ?. "_" table) (modify-syntax-entry ?# "<" table) ; # single-line comment start (modify-syntax-entry ?\n ">" table) ; \n single-line comment end (modify-syntax-entry ?\{ "(} " table) @@ -27,8 +28,10 @@ (modify-syntax-entry ?\( "() " table) (modify-syntax-entry ?\) ")( " table) ;(modify-syntax-entry ?\\ "." table) ; \ is an operator outside quotes -(modify-syntax-entry ?' "." table) ; character quote or transpose -;(modify-syntax-entry ?\" "." table) +(modify-syntax-entry ?' "." table) ; character quote or transpose +(modify-syntax-entry ?\" "\"" table) +(modify-syntax-entry ?` "\"" table) +;; (modify-syntax-entry ?\" "." table) (modify-syntax-entry ?? "." table) (modify-syntax-entry ?$ "." table) (modify-syntax-entry ?& "." table) @@ -40,20 +43,20 @@ (modify-syntax-entry ?= "." table) (modify-syntax-entry ?% "." table) table) - "Syntax table for julia-mode") + "Syntax table for `julia-mode'.") ;; syntax table that holds within strings (defvar julia-mode-string-syntax-table (let ((table (make-syntax-table))) table) - "Syntax table for julia-mode") + "Syntax table for `julia-mode'.") ;; disable " inside char quote (defvar julia-mode-char-syntax-table (let ((table (make-syntax-table))) (modify-syntax-entry ?\" "." table) table) - "Syntax table for julia-mode") + "Syntax table for `julia-mode'.") (defconst julia-string-regex "\"[^\"]*?\\(\\(\\)*\"[^\"]*?\\)*\"") @@ -139,7 +142,9 @@ (julia-strcount before ?] (defun julia-at-keyword (kw-list) - ; not a keyword if used as a field name, X.word, or quoted, :word + "Return the word at point if it matches any keyword in KW-LIST. +KW-LIST is a list of strings. The word at point is not considered +a keyword if used as a field name, X.word, or quoted, :word." (and (or (= (point) 1) (and (not (equal (char-before (point)) ?.)) (not (equal (char-before (point)) ?: @@ -150,10 +155,11 @@ ;; if backward-sexp gives an error, move back 1 char to move over the '(' (defun julia-safe-backward-sexp () (if (condition-case nil (backward-sexp) (error t)) - (error2nil (backward-char + (ignore-errors (backward-char -; get the position of the last open block (defun julia-last-open-block-pos (min) + "Move back and return the position of the last open block, if one found. +Do not move back beyond position MIN." (let ((count 0)) (while (not (or (> count 0) (<= (point) min))) (julia-safe-backward-sexp) @@ -168,43 +174,44 @@ (point) nil))) -; get indent for last open block (defun julia-last-open-block (min) + "Move back and return indentation level for last open block. +Do not move back beyond MIN." (let ((pos (julia-last-open-block-pos min))) (and pos (progn (goto-char pos) (+ julia-basic-offset (current-indentation)) -(defmacro error2nil (body) `(condition-case nil ,body (error nil))) - (defun julia-paren-indent () - (let* ((p (parse-partial-sexp (save-excursion - ;; only indent by paren if the last open - ;; paren is closer than the last open - ;; block - (or (julia-last-open-block-pos (point-min)) - (point-min))) - (progn (beginning-of-line) - (point + "Return indent by last opening paren." + (let* ((p (parse-partial-sexp + (save-excursion + ;; only indent by paren if the last open + ;; paren is closer than the last open + ;; block + (or (julia-last-open-block-pos (point-min)) + (point-min))) + (progn (beginning-of-line) +(point
[nongnu] elpa/julia-mode 9d08954 292/352: Update keywords and builtin types to Julia 1.0
branch: elpa/julia-mode commit 9d08954da2454281af10528054ba39a0419fbd59 Author: Éric Thiébaut Commit: Éric Thiébaut Update keywords and builtin types to Julia 1.0 - Add \prime to the list of word constituent. - Fix/replace a number of keywords and builtin types for Julia 1.0 syntax. - Add `Cstring` and `Cwstring` to the list of builtin types. - Add `undef` to the list of font lock keywords. --- julia-mode.el | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index d54953b..7c0916e 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -117,6 +117,8 @@ This function provides equivalent functionality, but makes no efforts to optimis (modify-syntax-entry ?< "." table) (modify-syntax-entry ?> "." table) (modify-syntax-entry ?% "." table) + +(modify-syntax-entry ?′ "w" table) ; \prime is a word constituent table) "Syntax table for `julia-mode'.") @@ -242,7 +244,7 @@ This function provides equivalent functionality, but makes no efforts to optimis (not (any "=" (defconst julia-type-regex - (rx symbol-start (or "immutable" "type" ;; remove after 0.6 + (rx symbol-start (or ;;"immutable" "type" ;; remove after 0.6 "abstract type" "primitive type" "struct" "mutable struct") (1+ space) (group (1+ (or word (syntax symbol)) @@ -264,8 +266,9 @@ This function provides equivalent functionality, but makes no efforts to optimis "try" "catch" "return" "local" "function" "macro" "ccall" "finally" "break" "continue" "global" "where" "module" "using" "import" "export" "const" "let" "do" "in" - "baremodule" "importall" - "immutable" "type" "bitstype" "abstract" "typealias" ;; remove after 0.6 + "baremodule" + ;; "importall" ;; deprecated in 0.7 + ;; "immutable" "type" "bitstype" "abstract" "typealias" ;; removed in 1.0 "abstract type" "primitive type" "struct" "mutable struct") 'symbols)) @@ -281,16 +284,18 @@ This function provides equivalent functionality, but makes no efforts to optimis "UInt" "UInt8" "UInt16" "UInt32" "UInt64" "UInt128" "Int" "Int8" "Int16" "Int32" "Int64" "Int128" "BigFloat" "AbstractFloat" "Float16" "Float32" "Float64" - "Complex128" "Complex64" + ;;"Complex128" "Complex64" ;; replaced in 1.0 + "ComplexF32" "ComplexF64" "Bool" "Cuchar" "Cshort" "Cushort" "Cint" "Cuint" "Clonglong" "Culonglong" "Cintmax_t" "Cuintmax_t" "Cfloat" "Cdouble" "Cptrdiff_t" "Cssize_t" "Csize_t" - "Cchar" "Clong" "Culong" "Cwchar_t" + "Cchar" "Clong" "Culong" "Cwchar_t" "Cvoid" + "Cstring" "Cwstring" ;; C strings made of ordinary and wide characters "Char" "String" "SubString" "Array" "DArray" "AbstractArray" "AbstractVector" "AbstractMatrix" "AbstractSparseMatrix" "SubArray" "StridedArray" "StridedVector" "StridedMatrix" "VecOrMat" "StridedVecOrMat" "DenseArray" "SparseMatrixCSC" "BitArray" - "Range" "OrdinalRange" "StepRange" "UnitRange" "FloatRange" + "AbstractRange" "OrdinalRange" "StepRange" "UnitRange" "FloatRange" "Tuple" "NTuple" "Vararg" - "DataType" "Symbol" "Function" "Vector" "Matrix" "Union" "Type" "Any" "Complex" "AbstractString" "Ptr" "Void" "Exception" "Task" "Signed" "Unsigned" "Associative" "Dict" "IO" "IOStream" "Rational" "Regex" "RegexMatch" "Set" "IntSet" "Expr" "WeakRef" "ObjectIdDict" + "DataType" "Symbol" "Function" "Vector" "Matrix" "Union" "Type" "Any" "Complex" "AbstractString" "Ptr" "Nothing" "Exception" "Task" "Signed" "Unsigned" "Associative" "Dict" "IO" "IOStream" "Rational" "Regex" "RegexMatch" "Set" "IntSet" "Expr" "WeakRef" "ObjectIdDict" "AbstractRNG" "MersenneTwister" ) 'symbols)) @@ -313,7 +318,7 @@ This function provides equivalent functionality, but makes no efforts to optimis (cons julia-macro-regex ''julia-macro-face) (cons (julia--regexp-opt - '("true" "false" "C_NULL" "Inf" "NaN" "Inf32" "NaN32" "nothing") + '("true" "false" "C_NULL" "Inf" "NaN" "Inf32" "NaN32" "nothing" "undef") 'symbols) 'font-lock-constant-face) (list julia-unquote-regex 2 'font-lock-constant-face) @@ -330,7 +335,7 @@ This function provides equivalent functionality, but makes no efforts to optimis (defconst julia-block-start-keywords (list "if" "while" "for" "begin" "try" "function" "let" "macro" "quote" "do" "module" -"immutable" "type" ;; remove after 0.6 +;; "immutable" "type" ;; remove after 0.6 "abstract type" "primitive type" "struct" "mutable struct")) ;; For keywords that begin a block without additional indentation
[nongnu] elpa/julia-mode 9edff28 291/352: Merge pull request #68 from nverno/fix-compilation
branch: elpa/julia-mode commit 9edff28729008f828566008c41ac4e9229a135c3 Merge: dc21978 e27e6d2 Author: Yichao Yu Commit: GitHub Merge pull request #68 from nverno/fix-compilation fix compilation error, silence most compile warnings --- .travis.yml | 4 ++-- julia-mode.el | 38 +- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5ecccec..a542264 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,9 +36,9 @@ install: script: - $EMACS --version - - $EMACS --batch --eval '(progn (push "." load-path) (byte-compile-file "julia-mode.el"))' + - $EMACS --batch -L . --eval "(and (>= emacs-major-version 24) (setq byte-compile-error-on-warn t))" -f batch-byte-compile julia-mode.el - if [ "$EMACS" != emacs23 ]; then - $EMACS -batch -L . -l ert -l julia-mode-tests.el -f ert-run-tests-batch-and-exit; + $EMACS -batch -L . -l ert -l julia-mode-tests.el -f ert-run-tests-batch-and-exit; fi notifications: diff --git a/julia-mode.el b/julia-mode.el index 2bb36f4..d54953b 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -363,14 +363,14 @@ Based on `python-syntax-stringify'." (put-text-property string-start-pos (1+ string-start-pos) 'syntax-table (string-to-syntax "|")) -(unless (< emacs-major-version 24) - (defconst julia-syntax-propertize-function +(defconst julia-syntax-propertize-function + (unless (< emacs-major-version 24) (syntax-propertize-rules ("\"\"\"" (0 (ignore (julia-stringify-triple-quote (julia-char-regex - (1 "\"") ; Treat ' as a string delimiter. - (2 ".") ; Don't highlight anything between. + (1 "\"") ; Treat ' as a string delimiter. + (2 ".") ; Don't highlight anything between. (3 "\"") ; Treat the last " in """ as a string delimiter. (defun julia-in-comment (&optional syntax-ppss) @@ -641,9 +641,9 @@ meaning always increase indent on TAB and decrease on S-TAB." ;;; Navigation ;; based off python.el (defconst julia-beginning-of-defun-regex - (eval-when-compile (concat julia-function-regex "\\|" - julia-function-assignment-regex "\\|" - "\\_")) + (concat julia-function-regex "\\|" + julia-function-assignment-regex "\\|" + "\\_") "Regex matching beginning of Julia function or macro.") (defun julia-syntax-context-type (&optional syntax-ppss) @@ -791,12 +791,12 @@ Return nil if point is not in a function, otherwise point." (list `(,julia-char-regex (1 "\"") ; Treat ' as a string delimiter. - (2 ".") ; Don't highlight anything between the open and close '. - (3 "\"")); Treat the close ' as a string delimiter. + (2 ".") ; Don't highlight anything between the open and close '. + (3 "\"")) ; Treat the close ' as a string delimiter. `(,julia-triple-quoted-string-regex - (1 "\"") ; Treat the first " in """ as a string delimiter. - (2 ".") ; Don't highlight anything between. - (3 "\"" ; Treat the last " in """ as a string delimiter. + (1 "\""); Treat the first " in """ as a string delimiter. + (2 ".") ; Don't highlight anything between. + (3 "\"" ; Treat the last " in """ as a string delimiter. ;; Emacs 24 and later has syntax-propertize-function, so use that instead. (set (make-local-variable 'syntax-propertize-function) julia-syntax-propertize-function)) @@ -855,6 +855,8 @@ strings." ;; (add-hook 'inferior-julia-mode-hook 'julia-math-mode) (when (require 'latex nil t) + (declare-function LaTeX-math-abbrev-prefix "latex") + (defun julia-math-insert (s) "Inserts math symbol given by `s'" (when s @@ -862,15 +864,17 @@ strings." (when sym (insert sym) - (define-minor-mode julia-math-mode -"A minor mode with easy access to TeX math commands. The + (with-no-warnings +(define-minor-mode julia-math-mode + "A minor mode with easy access to TeX math commands. The command is only entered if it is supported in Julia. The following commands are defined: \\{LaTeX-math-mode-map}" -nil nil (list (cons (LaTeX-math-abbrev-prefix) LaTeX-math-keymap)) -(if julia-math-mode -(set (make-local-variable 'LaTeX-math-insert-function) 'julia-math-insert + nil nil (list (cons (LaTeX-math-abbrev-prefix) LaTeX-math-keymap)) + (if julia-math-mode + (set (make-local-variable 'LaTeX-math-insert-function) + 'julia-math-insert) ;; Code for `inferior-julia-mode' (require 'comint)
[nongnu] elpa/julia-mode 6603c79 190/352: rename Uint -> UInt in contrib files for syntax highlighting
branch: elpa/julia-mode commit 6603c79263ccad298c89ddc217f8c1842ff31dbd Author: Simon Byrne Commit: Yichao Yu rename Uint -> UInt in contrib files for syntax highlighting --- julia-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index afb18c8..0d71c08 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -179,7 +179,7 @@ This function provides equivalent functionality, but makes no efforts to optimis (defconst julia-builtin-types-regex (julia--regexp-opt '("Number" "Real" "BigInt" "Integer" - "Uint" "Uint8" "Uint16" "Uint32" "Uint64" "Uint128" + "UInt" "UInt8" "UInt16" "UInt32" "UInt64" "UInt128" "Int" "Int8" "Int16" "Int32" "Int64" "Int128" "BigFloat" "FloatingPoint" "Float16" "Float32" "Float64" "Complex128" "Complex64" "ComplexPair"
[nongnu] elpa/julia-mode 1332b74 262/352: update for changed type keywords in 0.6
branch: elpa/julia-mode commit 1332b74fb13cf3d098ce5f5065c73dac00dfd637 Author: Jeff Bezanson Commit: Jeff Bezanson update for changed type keywords in 0.6 --- julia-mode.el | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index 48cffa5..7f90080 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -240,7 +240,9 @@ This function provides equivalent functionality, but makes no efforts to optimis (not (any "=" (defconst julia-type-regex - (rx symbol-start (or "immutable" "type" "abstract") (1+ space) (group (1+ (or word (syntax symbol)) + (rx symbol-start (or "immutable" "type" ;; remove after 0.6 + "abstract type" "primitive type" "struct" "mutable struct") + (1+ space) (group (1+ (or word (syntax symbol)) (defconst julia-type-annotation-regex (rx "::" (0+ space) (group (1+ (or word (syntax symbol)) @@ -257,10 +259,12 @@ This function provides equivalent functionality, but makes no efforts to optimis (defconst julia-keyword-regex (julia--regexp-opt '("if" "else" "elseif" "while" "for" "begin" "end" "quote" - "try" "catch" "return" "local" "abstract" "function" "macro" "ccall" - "finally" "typealias" "break" "continue" "type" "global" - "module" "using" "import" "export" "const" "let" "bitstype" "do" "in" - "baremodule" "importall" "immutable") + "try" "catch" "return" "local" "function" "macro" "ccall" + "finally" "break" "continue" "global" + "module" "using" "import" "export" "const" "let" "do" "in" + "baremodule" "importall" + "immutable" "type" "bitstype" "abstract" "typealias" ;; remove after 0.6 + "abstract type" "primitive type" "struct" "mutable struct") 'symbols)) (defconst julia-builtin-regex @@ -322,8 +326,10 @@ This function provides equivalent functionality, but makes no efforts to optimis )) (defconst julia-block-start-keywords - (list "if" "while" "for" "begin" "try" "function" "type" "let" "macro" -"quote" "do" "immutable" "module")) + (list "if" "while" "for" "begin" "try" "function" "let" "macro" +"quote" "do" "module" +"immutable" "type" ;; remove after 0.6 +"abstract type" "primitive type" "struct" "mutable struct")) ;; For keywords that begin a block without additional indentation (defconst julia-block-start-keywords-no-indent
[nongnu] elpa/julia-mode deda1e2 284/352: Add test
branch: elpa/julia-mode commit deda1e2f9a388e8e7e23d1a6c275bfba7225a46b Author: Jamie Brandon Commit: Jamie Brandon Add test --- julia-mode-tests.el | 7 +++ 1 file changed, 7 insertions(+) diff --git a/julia-mode-tests.el b/julia-mode-tests.el index be3856a..4f24513 100644 --- a/julia-mode-tests.el +++ b/julia-mode-tests.el @@ -435,6 +435,13 @@ end") end" pos 'font-lock-keyword-face))) +(ert-deftest julia--test-escaped-strings-dont-terminate-string () + "Symbols get font-locked at beginning or line." + (let ((string "\"\\\"\"; function")) +(dolist (pos '(1 2 3 4)) + (julia--should-font-lock string pos font-lock-string-face)) +(julia--should-font-lock string (length string) font-lock-keyword-face))) + (defun julia--run-tests () (interactive) (if (featurep 'ert)
[nongnu] elpa/julia-mode cde82a9 120/352: Add Float16 to julia-mode.el
branch: elpa/julia-mode commit cde82a9ff05130f9316c23917b7af71e4ddd0d70 Author: Viral B. Shah Commit: Yichao Yu Add Float16 to julia-mode.el --- julia-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index c168057..c9391cd 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -69,7 +69,7 @@ ].* \\(in\\)\\(\\s-\\|$\\)+") (defconst julia-font-lock-keywords - (list '("\\<\\(\\|Uint\\(8\\|16\\|32\\|64\\|128\\)\\|Int\\(8\\|16\\|32\\|64\\|128\\)\\|BigInt\\|Integer\\|BigFloat\\|FloatingPoint\\|Float32\\|Float64\\|Complex128\\|Complex64\\|ComplexPair\\|Bool\\|Char\\|Number\\|Real\\|Int\\|Uint\\|Array\\|DArray\\|AbstractArray\\|AbstractVector\\|AbstractMatrix\\|AbstractSparseMatrix\\|SubArray\\|StridedArray\\|StridedVector\\|StridedMatrix\\|VecOrMat\\|StridedVecOrMat\\|Range\\|Range1\\|SparseMatrixCSC\\|Tuple\\|NTuple\\|Symbol\\|Function\\|Vector [...] + (list '("\\<\\(\\|Uint\\(8\\|16\\|32\\|64\\|128\\)\\|Int\\(8\\|16\\|32\\|64\\|128\\)\\|BigInt\\|Integer\\|BigFloat\\|FloatingPoint\\|Float16\\|Float32\\|Float64\\|Complex128\\|Complex64\\|ComplexPair\\|Bool\\|Char\\|Number\\|Real\\|Int\\|Uint\\|Array\\|DArray\\|AbstractArray\\|AbstractVector\\|AbstractMatrix\\|AbstractSparseMatrix\\|SubArray\\|StridedArray\\|StridedVector\\|StridedMatrix\\|VecOrMat\\|StridedVecOrMat\\|Range\\|Range1\\|SparseMatrixCSC\\|Tuple\\|NTuple\\|Symbol\\|Functio [...] font-lock-type-face) (cons (concat "\\<\\("
[nongnu] elpa/julia-mode af5eb63 273/352: short function syntax: support return type declaration
branch: elpa/julia-mode commit af5eb639d68640ea5eec51d4d89d1fdab5b4b113 Author: Rafael Fourquet Commit: Rafael Fourquet short function syntax: support return type declaration --- julia-mode-tests.el | 4 +++- julia-mode.el | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/julia-mode-tests.el b/julia-mode-tests.el index f2320a3..1965fc8 100644 --- a/julia-mode-tests.el +++ b/julia-mode-tests.el @@ -425,7 +425,9 @@ end") (julia--should-font-lock "f(x) where T = 1" 1 'font-lock-function-name-face) (julia--should-font-lock - "f(x) where{T} = 1" 1 'font-lock-function-name-face)) + "f(x) where{T} = 1" 1 'font-lock-function-name-face) + (dolist (def '("f(x)::T = 1" "f(x) :: T = 1" "f(x::X)::T where X = x")) +(julia--should-font-lock def 1 'font-lock-function-name-face))) (ert-deftest julia--test-where-keyword-font-locking () (julia--should-font-lock diff --git a/julia-mode.el b/julia-mode.el index 737e44a..daf42d7 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -235,6 +235,8 @@ This function provides equivalent functionality, but makes no efforts to optimis (not (any "(" ")" ")" (* space) + (? "::" (* space) (1+ (not (any space + (* space) (* (seq "where" (or "{" (+ space)) (+ (not (any "=") "=" (not (any "="
[nongnu] elpa/julia-mode 80c6754 197/352: Silencing byte-compiler warning.
branch: elpa/julia-mode commit 80c67541294bb2338a93f5de7d7f8c8e3915c8e5 Author: Wilfred Hughes Commit: Yichao Yu Silencing byte-compiler warning. This is warning is harmless (I'm not aware of any plans to remove `font-lock-syntactic-keywords`) but it has caused concern amongst users. See https://github.com/JuliaLang/julia/pull/9042 --- julia-mode.el | 1 + 1 file changed, 1 insertion(+) diff --git a/julia-mode.el b/julia-mode.el index 4504c49..1fa44ca 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -2910,5 +2910,6 @@ before point. Returns nil if we're not within nested parens." ;; Local Variables: ;; coding: utf-8 +;; byte-compile-warnings: (not obsolete) ;; End: ;;; julia-mode.el ends here
[nongnu] elpa/julia-mode 72d2e0f 123/352: Add support for Float16 to various array constructors
branch: elpa/julia-mode commit 72d2e0f4beeaee3986655405d01be0606990ba54 Author: Viral B. Shah Commit: Yichao Yu Add support for Float16 to various array constructors --- julia-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index c9391cd..5cbbff9 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -69,7 +69,7 @@ ].* \\(in\\)\\(\\s-\\|$\\)+") (defconst julia-font-lock-keywords - (list '("\\<\\(\\|Uint\\(8\\|16\\|32\\|64\\|128\\)\\|Int\\(8\\|16\\|32\\|64\\|128\\)\\|BigInt\\|Integer\\|BigFloat\\|FloatingPoint\\|Float16\\|Float32\\|Float64\\|Complex128\\|Complex64\\|ComplexPair\\|Bool\\|Char\\|Number\\|Real\\|Int\\|Uint\\|Array\\|DArray\\|AbstractArray\\|AbstractVector\\|AbstractMatrix\\|AbstractSparseMatrix\\|SubArray\\|StridedArray\\|StridedVector\\|StridedMatrix\\|VecOrMat\\|StridedVecOrMat\\|Range\\|Range1\\|SparseMatrixCSC\\|Tuple\\|NTuple\\|Symbol\\|Functio [...] + (list '("\\<\\(\\|Uint\\(8\\|16\\|32\\|64\\|128\\)\\|Int\\(8\\|16\\|32\\|64\\|128\\)\\|BigInt\\|Integer\\|BigFloat\\|FloatingPoint\\|Float16\\|Float32\\|Float64\\|Complex128\\|Complex64\\|Complex32\\|ComplexPair\\|Bool\\|Char\\|Number\\|Real\\|Int\\|Uint\\|Array\\|DArray\\|AbstractArray\\|AbstractVector\\|AbstractMatrix\\|AbstractSparseMatrix\\|SubArray\\|StridedArray\\|StridedVector\\|StridedMatrix\\|VecOrMat\\|StridedVecOrMat\\|Range\\|Range1\\|SparseMatrixCSC\\|Tuple\\|NTuple\\|Symb [...] font-lock-type-face) (cons (concat "\\<\\("
[nongnu] elpa/julia-mode 115d4dc 277/352: Regenerate latex auto completion (#45)
branch: elpa/julia-mode commit 115d4dc8a07445301772da8376b232fa8c7168f4 Author: Yichao Yu Commit: GitHub Regenerate latex auto completion (#45) --- julia-mode.el | 361 ++ 1 file changed, 189 insertions(+), 172 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index 0127f5d..271f500 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -794,7 +794,6 @@ strings." (puthash "\\Elzopeno" "ɔ" julia-latexsubs) (puthash "\\Elzrtld" "ɖ" julia-latexsubs) (puthash "\\Elzschwa" "ə" julia-latexsubs) -(puthash "\\varepsilon" "ɛ" julia-latexsubs) (puthash "\\Elzpgamma" "ɣ" julia-latexsubs) (puthash "\\Elzpbgam" "ɤ" julia-latexsubs) (puthash "\\Elztrnh" "ɥ" julia-latexsubs) @@ -873,11 +872,12 @@ strings." (puthash "\\k" "̨" julia-latexsubs) (puthash "\\Elzsbbrg" "̪" julia-latexsubs) (puthash "\\wideutilde" "̰" julia-latexsubs) -(puthash "\\underbar" "̱" julia-latexsubs) +(puthash "\\underbar" "̲" julia-latexsubs) (puthash "\\Elzxl" "̵" julia-latexsubs) (puthash "\\Elzbar" "̶" julia-latexsubs) (puthash "\\sout" "̶" julia-latexsubs) (puthash "\\not" "̸" julia-latexsubs) +(puthash "\\underleftrightarrow" "͍" julia-latexsubs) (puthash "\\Alpha" "Α" julia-latexsubs) (puthash "\\Beta" "Β" julia-latexsubs) (puthash "\\Gamma" "Γ" julia-latexsubs) @@ -907,6 +907,7 @@ strings." (puthash "\\gamma" "γ" julia-latexsubs) (puthash "\\delta" "δ" julia-latexsubs) (puthash "\\upepsilon" "ε" julia-latexsubs) +(puthash "\\varepsilon" "ε" julia-latexsubs) (puthash "\\zeta" "ζ" julia-latexsubs) (puthash "\\eta" "η" julia-latexsubs) (puthash "\\theta" "θ" julia-latexsubs) @@ -946,58 +947,58 @@ strings." (puthash "\\textTheta" "ϴ" julia-latexsubs) (puthash "\\epsilon" "ϵ" julia-latexsubs) (puthash "\\backepsilon" "϶" julia-latexsubs) -(puthash "\\^A" "\u1d2c" julia-latexsubs) -(puthash "\\^B" "\u1d2e" julia-latexsubs) -(puthash "\\^D" "\u1d30" julia-latexsubs) -(puthash "\\^E" "\u1d31" julia-latexsubs) -(puthash "\\^G" "\u1d33" julia-latexsubs) -(puthash "\\^H" "\u1d34" julia-latexsubs) -(puthash "\\^I" "\u1d35" julia-latexsubs) -(puthash "\\^J" "\u1d36" julia-latexsubs) -(puthash "\\^K" "\u1d37" julia-latexsubs) -(puthash "\\^L" "\u1d38" julia-latexsubs) -(puthash "\\^M" "\u1d39" julia-latexsubs) -(puthash "\\^N" "\u1d3a" julia-latexsubs) -(puthash "\\^O" "\u1d3c" julia-latexsubs) -(puthash "\\^P" "\u1d3e" julia-latexsubs) -(puthash "\\^R" "\u1d3f" julia-latexsubs) -(puthash "\\^T" "\u1d40" julia-latexsubs) -(puthash "\\^U" "\u1d41" julia-latexsubs) -(puthash "\\^W" "\u1d42" julia-latexsubs) -(puthash "\\^a" "\u1d43" julia-latexsubs) -(puthash "\\^alpha" "\u1d45" julia-latexsubs) -(puthash "\\^b" "\u1d47" julia-latexsubs) -(puthash "\\^d" "\u1d48" julia-latexsubs) -(puthash "\\^e" "\u1d49" julia-latexsubs) -(puthash "\\^epsilon" "\u1d4b" julia-latexsubs) -(puthash "\\^g" "\u1d4d" julia-latexsubs) -(puthash "\\^k" "\u1d4f" julia-latexsubs) -(puthash "\\^m" "\u1d50" julia-latexsubs) -(puthash "\\^o" "\u1d52" julia-latexsubs) -(puthash "\\^p" "\u1d56" julia-latexsubs) -(puthash "\\^t" "\u1d57" julia-latexsubs) -(puthash "\\^u" "\u1d58" julia-latexsubs) -(puthash "\\^v" "\u1d5b" julia-latexsubs) -(puthash "\\^beta" "\u1d5d" julia-latexsubs) -(puthash "\\^gamma" "\u1d5e" julia-latexsubs) -(puthash "\\^delta" "\u1d5f" julia-latexsubs) -(puthash "\\^phi" "\u1d60" julia-latexsubs) -(puthash "\\^chi" "\u1d61" julia-latexsubs) -(puthash "\\_i" "\u1d62" julia-latexsubs) -(puthash "\\_r" "\u1d63" julia-latexsubs) -(puthash "\\_u" "\u1d64" julia-latexsubs) -(puthash "\\_v" "\u1d65" julia-latexsubs) -(puthash "\\_beta" "\u1d66" julia-latexsubs) -(puthash "\\_gamma" "\u1d67" julia-latexsubs) -(puthash "\\_rho" "\u1d68" julia-latexsubs) -(puthash "\\_phi" "\u1d69" julia-latexsubs) -(puthash "\\_chi" "\u1d6a" julia-latexsubs) -(puthash "\\^c" "\u1d9c" julia-latexsubs) -(puthash "\\^f" "\u1da0" julia-latexsubs) -(puthash "\\^iota" "\u1da5" julia-latexsubs) -(puthash "\\^Phi" "\u1db2" julia-latexsubs) -(puthash "\\^z" "\u1dbb" julia-latexsubs) -(puthash "\\^theta" "\u1dbf" julia-latexsubs) +(puthash "\\^A" "ᴬ" julia-latexsubs) +(puthash "\\^B" "ᴮ" julia-latexsubs) +(puthash "\\^D" "ᴰ" julia-latexsubs) +(puthash "\\^E" "ᴱ" julia-latexsubs) +(puthash "\\^G" "ᴳ" julia-latexsubs) +(puthash "\\^H" "ᴴ" julia-latexsubs) +(puthash "\\^I" "ᴵ" julia-latexsubs) +(puthash "\\^J" "ᴶ" julia-latexsubs) +(puthash "\\^K" "ᴷ" julia-latexsubs) +(puthash "\\^L" "ᴸ" julia-latexsubs) +(puthash "\\^M" "ᴹ" julia-latexsubs) +(puthash "\\^N" "ᴺ" julia-latexsubs) +(puthash "\\^O" "ᴼ" julia-latexsubs) +(puthash "\\^P" "ᴾ" julia-latexsubs) +(puthash "\\^R" "ᴿ" julia-latexsubs) +(puthash "\\^T" "ᵀ" julia-latexsubs) +(puthash "\\^U" "ᵁ" julia-latexsubs) +(puthash "\\^W" "ᵂ" julia-latexsubs) +(puthash "\\^a" "ᵃ" julia-latexsubs) +(puthash "\\^alpha" "ᵅ" julia-latexsubs) +(puthash "\\^b" "ᵇ" julia-latexsubs) +(puthash "\\^d" "ᵈ" julia-latexsubs) +(puthash "\\^e" "ᵉ" julia-latexsubs) +(puthash "\\^epsilon
[nongnu] elpa/julia-mode 10ce821 310/352: Add MELPA badge, clarify installation.
branch: elpa/julia-mode commit 10ce821caff88626048c6c5796e07b413aae34ce Author: Tamas K. Papp Commit: Tamas K. Papp Add MELPA badge, clarify installation. Fixes #89. --- README.md | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b2a7484..6d95ec1 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,21 @@ [](https://travis-ci.org/JuliaEditorSupport/julia-emacs) -# Install +[](https://melpa.org/#/julia-mode) -Put the following code in your `.emacs`, `site-load.el`, or other relevant file +# Installation + +## Installing from MELPA + +Unless you want to develop this package, it is recommended that you use it from MELPA: + +1. [Enable the MELPA repository](https://melpa.org/#/getting-started). + +2. Add `(require 'julia-mode)` to your Emacs init file. + +## Using the source repository directly + +Clone this repository, then use ```elisp (add-to-list 'load-path "path-to-julia-mode")
[nongnu] elpa/julia-mode f3f2ad1 198/352: Highlight triple quoted strings.
branch: elpa/julia-mode commit f3f2ad18229e7194d28ca83edca010766037ac7a Author: Wilfred Hughes Commit: Yichao Yu Highlight triple quoted strings. --- julia-mode.el | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index 1fa44ca..7bb8676 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -114,6 +114,18 @@ This function provides equivalent functionality, but makes no efforts to optimis "")) (group "'"))) +(defconst julia-triple-quoted-string-regex + ;; We deliberately put a group on the first and last delimiter, so + ;; we can mark these as string delimiters for font-lock. + (rx (group "\"") + (group "\"\"" + ;; After the delimiter, we're a sequence of + ;; non-backslashes or blackslashes paired with something. + (*? (or (not (any "\\")) + (seq "\\" anything))) + "\"\"") + (group "\""))) + (defconst julia-unquote-regex "\\(\\s(\\|\\s-\\|-\\|[,%=<>\\+*/?&|!\\^~;:]\\|^\\)\\($[a-zA-Z0-9_]+\\)") @@ -391,10 +403,14 @@ before point. Returns nil if we're not within nested parens." (set (make-local-variable 'font-lock-defaults) '(julia-font-lock-keywords)) (set (make-local-variable 'font-lock-syntactic-keywords) (list - `(,julia-char-regex +`(,julia-char-regex (1 "\"") ; Treat ' as a string delimiter. (2 ".") ; Don't highlight anything between the open and close '. - (3 "\"")) ; Treat the close ' as a string delimiter. + (3 "\"")); Treat the close ' as a string delimiter. +`(,julia-triple-quoted-string-regex + (1 "\"") ; Treat the first " in """ as a string delimiter. + (2 ".") ; Don't highlight anything between. + (3 "\"")) ; Treat the last " in """ as a string delimiter. )) (set (make-local-variable 'indent-line-function) 'julia-indent-line) (set (make-local-variable 'julia-basic-offset) 4)
[nongnu] elpa/julia-mode 75dc105 124/352: Merge ESS changes to julia-mode.el with backwards compatibility.
branch: elpa/julia-mode commit 75dc1059e063e6c33122991e62b576006a626d96 Author: James Porter Commit: Yichao Yu Merge ESS changes to julia-mode.el with backwards compatibility. This is just commit 2bfcc92a5499a736d5a434ab9616bdf32a8d5950 with a few compatability fixes. --- julia-mode.el | 117 +- 1 file changed, 75 insertions(+), 42 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index 5cbbff9..6cfdfd9 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -14,10 +14,16 @@ (add-to-list 'auto-mode-alist '("\\.jl\\'" . julia-mode)) +;; define ignore-errors macro if it isn't present +;; (necessary for emacs 22 compatibility) +(when (not (fboundp 'ignore-errors)) + (defmacro ignore-errors (body) `(condition-case nil ,body (error nil + (defvar julia-mode-syntax-table (let ((table (make-syntax-table))) -(modify-syntax-entry ?_ "w" table) ; underscores in words -(modify-syntax-entry ?@ "w" table) +(modify-syntax-entry ?_ "_" table) ; underscores in words +(modify-syntax-entry ?@ "_" table) +(modify-syntax-entry ?. "_" table) (modify-syntax-entry ?# "<" table) ; # single-line comment start (modify-syntax-entry ?\n ">" table) ; \n single-line comment end (modify-syntax-entry ?\{ "(} " table) @@ -27,8 +33,10 @@ (modify-syntax-entry ?\( "() " table) (modify-syntax-entry ?\) ")( " table) ;(modify-syntax-entry ?\\ "." table) ; \ is an operator outside quotes -(modify-syntax-entry ?' "." table) ; character quote or transpose -;(modify-syntax-entry ?\" "." table) +(modify-syntax-entry ?' "." table) ; character quote or transpose +(modify-syntax-entry ?\" "\"" table) +(modify-syntax-entry ?` "\"" table) +;; (modify-syntax-entry ?\" "." table) (modify-syntax-entry ?? "." table) (modify-syntax-entry ?$ "." table) (modify-syntax-entry ?& "." table) @@ -40,20 +48,20 @@ (modify-syntax-entry ?= "." table) (modify-syntax-entry ?% "." table) table) - "Syntax table for julia-mode") + "Syntax table for `julia-mode'.") ;; syntax table that holds within strings (defvar julia-mode-string-syntax-table (let ((table (make-syntax-table))) table) - "Syntax table for julia-mode") + "Syntax table for `julia-mode'.") ;; disable " inside char quote (defvar julia-mode-char-syntax-table (let ((table (make-syntax-table))) (modify-syntax-entry ?\" "." table) table) - "Syntax table for julia-mode") + "Syntax table for `julia-mode'.") (defconst julia-string-regex "\"[^\"]*?\\(\\(\\)*\"[^\"]*?\\)*\"") @@ -65,11 +73,11 @@ "\\(\\s(\\|\\s-\\|-\\|[,%=<>\\+*/?&|!\\^~;:]\\|^\\)\\($[a-zA-Z0-9_]+\\)") (defconst julia-forloop-in-regex - "for +.*[^ + "for +.*[^ ].* \\(in\\)\\(\\s-\\|$\\)+") (defconst julia-font-lock-keywords - (list '("\\<\\(\\|Uint\\(8\\|16\\|32\\|64\\|128\\)\\|Int\\(8\\|16\\|32\\|64\\|128\\)\\|BigInt\\|Integer\\|BigFloat\\|FloatingPoint\\|Float16\\|Float32\\|Float64\\|Complex128\\|Complex64\\|Complex32\\|ComplexPair\\|Bool\\|Char\\|Number\\|Real\\|Int\\|Uint\\|Array\\|DArray\\|AbstractArray\\|AbstractVector\\|AbstractMatrix\\|AbstractSparseMatrix\\|SubArray\\|StridedArray\\|StridedVector\\|StridedMatrix\\|VecOrMat\\|StridedVecOrMat\\|Range\\|Range1\\|SparseMatrixCSC\\|Tuple\\|NTuple\\|Symb [...] + (list '("\\<\\(\\|Uint\\(8\\|16\\|32\\|64\\|128\\)\\|Int\\(8\\|16\\|32\\|64\\|128\\)\\|BigInt\\|Integer\\|BigFloat\\|FloatingPoint\\|Float16\\|Float32\\|Float64\\|Complex128\\|Complex64\\|ComplexPair\\|Bool\\|Char\\|Number\\|Real\\|Int\\|Uint\\|Array\\|DArray\\|AbstractArray\\|AbstractVector\\|AbstractMatrix\\|AbstractSparseMatrix\\|SubArray\\|StridedArray\\|StridedVector\\|StridedMatrix\\|VecOrMat\\|StridedVecOrMat\\|Range\\|Range1\\|SparseMatrixCSC\\|Tuple\\|NTuple\\|Symbol\\|Functio [...] font-lock-type-face) (cons (concat "\\<\\(" @@ -139,7 +147,9 @@ (julia-strcount before ?] (defun julia-at-keyword (kw-list) - ; not a keyword if used as a field name, X.word, or quoted, :word + "Return the word at point if it matches any keyword in KW-LIST. +KW-LIST is a list of strings. The word at point is not considered +a keyword if used as a field name, X.word, or quoted, :word." (and (or (= (point) 1) (and (not (equal (char-before (point)) ?.)) (not (equal (char-before (point)) ?: @@ -150,10 +160,11 @@ ;; if backward-sexp gives an error, move back 1 char to move over the '(' (defun julia-safe-backward-sexp () (if (condition-case nil (backward-sexp) (error t)) - (error2nil (backward-char + (ignore-errors (backward-char -; get the position of the last open block (defun julia-last-open-block-pos (min) + "Move back and return the position of the last open block, if one found. +Do not move back beyond position MIN." (let ((count 0)) (while (not (or (> count 0) (<= (point)
[nongnu] elpa/julia-mode 6408b96 306/352: Transition to cl-lib, drop support for Emacs 23.
branch: elpa/julia-mode commit 6408b96c1c97e41bc2af060d661afee4f7b22e89 Author: Tamas K. Papp Commit: Tamas K. Papp Transition to cl-lib, drop support for Emacs 23. Incidental changes: - use lexical binding (requires Emacs 24) - rename a variable map which was shadowing the eponymous function (innocuous here, but bad style) --- julia-mode.el | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index 3c656cb..cffc466 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -1,8 +1,8 @@ -;;; julia-mode.el --- Major mode for editing Julia source code +;;; julia-mode.el --- Major mode for editing Julia source code -*- lexical-binding: t -*- ;; Copyright (C) 2009-2014 Julia contributors ;; URL: https://github.com/JuliaLang/julia -;; Version: 0.3 +;; Version: 0.4 ;; Keywords: languages ;;; Usage: @@ -35,10 +35,7 @@ ;;; Code: -;; We can't use cl-lib whilst supporting Emacs 23 users who don't use -;; ELPA. -(with-no-warnings - (require 'cl)) ;; incf, decf, plusp +(require 'cl-lib) (defvar julia-mode-hook nil) @@ -402,14 +399,14 @@ As a result, it is true inside \"foo\", `foo` and 'f'." (unless (or (julia-in-string) (julia-in-comment)) (when (looking-at (rx "[")) -(incf open-count)) +(cl-incf open-count)) (when (looking-at (rx "]")) -(decf open-count))) +(cl-decf open-count))) (forward-char 1))) ;; If we've opened more than we've closed, we're inside brackets. -(plusp open-count))) +(cl-plusp open-count))) (defun julia-at-keyword (kw-list) "Return the word at point if it matches any keyword in KW-LIST. @@ -462,7 +459,7 @@ symbol, gives up when this is not true." "Return the position of the last open block, if one found. Do not move back beyond position MIN." (save-excursion -(let ((count 0)) +(let ((cl-count 0)) (while (not (or (> count 0) (<= (point) min))) (julia-safe-backward-sexp) (setq count @@ -548,7 +545,7 @@ the (possibly narrowed) buffer, so there is nowhere else to go." ((and (= 0 this-move) (or (looking-at-p "^\\s-*\\(?:#.*\\)*$") (julia-in-comment))) - (incf moved)) + (cl-incf moved)) ;; success ((= 0 this-move) (throw 'result (1+ moved))) @@ -898,10 +895,10 @@ following commands are defined: "Regexp for matching `inferior-julia' prompt.") (defvar inferior-julia-mode-map - (let ((map (nconc (make-sparse-keymap) comint-mode-map))) + (let ((map2 (nconc (make-sparse-keymap) comint-mode-map))) ;; example definition -(define-key map (kbd "TAB") 'julia-latexsub-or-indent) -map) +(define-key map2 (kbd "TAB") 'julia-latexsub-or-indent) +map2) "Basic mode map for `inferior-julia-mode'.") ;;;###autoload
[nongnu] elpa/julia-mode 873639b 127/352: emacs mode: make @ a word character again
branch: elpa/julia-mode commit 873639b96a86dfb8473d62223953b140a0581dd0 Author: Jeff Bezanson Commit: Yichao Yu emacs mode: make @ a word character again this is really part of the identifier, and needed for proper coloring in some emacs versions --- julia-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index 96302f0..1fa1271 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -22,7 +22,7 @@ (defvar julia-mode-syntax-table (let ((table (make-syntax-table))) (modify-syntax-entry ?_ "w" table) ; underscores in words -(modify-syntax-entry ?@ "_" table) +(modify-syntax-entry ?@ "w" table) (modify-syntax-entry ?. "_" table) (modify-syntax-entry ?# "<" table) ; # single-line comment start (modify-syntax-entry ?\n ">" table) ; \n single-line comment end
[nongnu] elpa/julia-mode ff5fc36 202/352: julia-mode.el: allow space or no space after :: and <:
branch: elpa/julia-mode commit ff5fc36555c303033ff4f08a7c63dd2c0593646e Author: Rafael Fourquet Commit: Yichao Yu julia-mode.el: allow space or no space after :: and <: --- julia-mode.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index 5f54d68..fa0b3a0 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -164,13 +164,13 @@ This function provides equivalent functionality, but makes no efforts to optimis (rx symbol-start (or "immutable" "type" "abstract") (1+ space) (group (1+ (or word (syntax symbol)) (defconst julia-type-annotation-regex - (rx "::" (group (1+ (or word (syntax symbol)) + (rx "::" (0+ space) (group (1+ (or word (syntax symbol)) ;;(defconst julia-type-parameter-regex ;; (rx symbol-start (1+ (or (or word (syntax symbol)) ?_)) "{" (group (1+ (or (or word (syntax symbol)) ?_))) "}")) (defconst julia-subtype-regex - (rx "<:" (1+ space) (group (1+ (or word (syntax symbol (0+ space) (or "\n" "{" "end"))) + (rx "<:" (0+ space) (group (1+ (or word (syntax symbol (0+ space) (or "\n" "{" "}" "end"))) (defconst julia-macro-regex (rx symbol-start (group "@" (1+ (or word (syntax symbol))
[nongnu] elpa/julia-mode 4f024cb 313/352: make loading "julia-latexsubs" work when using `eval-buffer` (#83)
branch: elpa/julia-mode commit 4f024cbae1e1acc31685cc39559da88820b85ad7 Author: nverno Commit: Rafael Fourquet make loading "julia-latexsubs" work when using `eval-buffer` (#83) --- julia-mode.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index 3c656cb..707f32b 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -853,7 +853,8 @@ strings." ;;; populate LaTeX symbols hash table from a generated file. ;;; (See Julia issue #8947 for why we don't use the Emacs tex input mode.) -(load (expand-file-name "julia-latexsubs" (file-name-directory load-file-name))) +(load (expand-file-name "julia-latexsubs" +(file-name-directory (or buffer-file-name load-file-name ;; Math insertion in julia. Use it with ;; (add-hook 'julia-mode-hook 'julia-math-mode)
[nongnu] elpa/julia-mode 05f002c 203/352: When indenting code, limit how far back we search.
branch: elpa/julia-mode commit 05f002c685482f24277557dafc972ad5cc88ef4a Author: Wilfred Hughes Commit: Yichao Yu When indenting code, limit how far back we search. Fixes https://github.com/JuliaLang/julia/issues/9254 -- performance is just too bad on long files otherwise. --- julia-mode.el | 22 +++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index fa0b3a0..788a116 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -322,6 +322,8 @@ Do not move back beyond position MIN." (defun julia-last-open-block (min) "Move back and return indentation level for last open block. Do not move back beyond MIN." + ;; Ensure MIN is not before the start of the buffer. + (setq min (max min (point-min))) (let ((pos (julia-last-open-block-pos min))) (and pos (progn @@ -334,12 +336,26 @@ beginning of the buffer." (unless (eq (point) (point-min)) (backward-char))) +(defvar julia-max-paren-lookback 400 + "When indenting, don't look back more than this +many characters to see if there are unclosed parens. + +This variable has a major effect on indent performance if set too +high.") + +(defvar julia-max-block-lookback 5000 + "When indenting, don't look back more than this +many characters to see if there are unclosed blocks. + +This variable has a moderate effect on indent performance if set too +high.") + (defun julia-paren-indent () "Return the column position of the innermost containing paren before point. Returns nil if we're not within nested parens." (save-excursion -(let ((min-pos (or (julia-last-open-block-pos (point-min)) - (point-min))) +(let ((min-pos (max (- (point) julia-max-paren-lookback) +(point-min))) (open-count 0)) (while (and (> (point) min-pos) (not (plusp open-count))) @@ -383,7 +399,7 @@ before point. Returns nil if we're not within nested parens." (beginning-of-line) (forward-to-indentation 0) (let ((endtok (julia-at-keyword julia-block-end-keywords))) - (ignore-errors (+ (julia-last-open-block (point-min)) + (ignore-errors (+ (julia-last-open-block (- (point) julia-max-block-lookback)) (if endtok (- julia-basic-offset) 0) ;; Otherwise, use the same indentation as previous line. (save-excursion (forward-line -1)
[nongnu] elpa/julia-mode 88d7d87 332/352: Merge pull request #121 from JuliaEditorSupport/tp/prefer-rx
branch: elpa/julia-mode commit 88d7d875ef32eb9fb76917c97150654bb91ac96a Merge: 7de3b0c bfa54b2 Author: Tamas K. Papp Commit: GitHub Merge pull request #121 from JuliaEditorSupport/tp/prefer-rx Minor point about preferring the rx macro for regexs. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c9ce5a4..b180554 100644 --- a/README.md +++ b/README.md @@ -32,4 +32,6 @@ Please 2. add a short summary in the [Unreleased section of the CHANGELOG](CHANGELOG.md#unreleased). +3. use the `rx` macro (S-expressions) whenever rewriting existing regular expressions or introducing new ones; it keeps the code much more readable. + We do our best to provide feedback within 2 weeks, feel free to bump in a comment after that.
[nongnu] elpa/julia-mode 1eacdc6 298/352: Create FUNDING.yml
branch: elpa/julia-mode commit 1eacdc608b6ce1947db0a86e61f2061f00a96bc1 Author: Viral B. Shah Commit: GitHub Create FUNDING.yml --- .github/FUNDING.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000..cc27b73 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +custom: https://numfocus.salsalabs.org/donate-to-julia/index.html
[nongnu] elpa/julia-mode 4b22a79 205/352: julia-mode.el: remove types that are removed or deprecated
branch: elpa/julia-mode commit 4b22a795839625111ab08f199a2154c7d32b9f49 Author: Jeff Bezanson Commit: Yichao Yu julia-mode.el: remove types that are removed or deprecated --- julia-mode.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index b99cab1..e1974ca 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -196,16 +196,16 @@ This function provides equivalent functionality, but makes no efforts to optimis "UInt" "UInt8" "UInt16" "UInt32" "UInt64" "UInt128" "Int" "Int8" "Int16" "Int32" "Int64" "Int128" "BigFloat" "FloatingPoint" "Float16" "Float32" "Float64" - "Complex128" "Complex64" "ComplexPair" + "Complex128" "Complex64" "Bool" "Cuchar" "Cshort" "Cushort" "Cint" "Cuint" "Clonglong" "Culonglong" "Cintmax_t" "Cuintmax_t" "Cfloat" "Cdouble" "Cptrdiff_t" "Cssize_t" "Csize_t" "Cchar" "Clong" "Culong" "Cwchar_t" "Char" "ASCIIString" "UTF8String" "ByteString" "SubString" "Array" "DArray" "AbstractArray" "AbstractVector" "AbstractMatrix" "AbstractSparseMatrix" "SubArray" "StridedArray" "StridedVector" "StridedMatrix" "VecOrMat" "StridedVecOrMat" "DenseArray" "SparseMatrixCSC" "BitArray" - "Range" "Range1" "OrdinalRange" "StepRange" "UnitRange" "FloatRange" + "Range" "OrdinalRange" "StepRange" "UnitRange" "FloatRange" "Tuple" "NTuple" - "DataType" "Symbol" "Function" "Vector" "Matrix" "Union" "Type" "Any" "Complex" "None" "String" "Ptr" "Void" "Exception" "Task" "Signed" "Unsigned" "Associative" "Dict" "IO" "IOStream" "Ranges" "Rational" "Regex" "RegexMatch" "Set" "IntSet" "Expr" "WeakRef" "Nothing" "ObjectIdDict" + "DataType" "Symbol" "Function" "Vector" "Matrix" "Union" "Type" "Any" "Complex" "String" "Ptr" "Void" "Exception" "Task" "Signed" "Unsigned" "Associative" "Dict" "IO" "IOStream" "Rational" "Regex" "RegexMatch" "Set" "IntSet" "Expr" "WeakRef" "ObjectIdDict" "AbstractRNG" "MersenneTwister" ) 'symbols))
[nongnu] elpa/julia-mode 864e124 311/352: remove newline
branch: elpa/julia-mode commit 864e1244a7e74248bdad82c900e20384af26e82f Author: Tamas K. Papp Commit: Tamas K. Papp remove newline --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 6d95ec1..cfc4eb7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # Emacs major mode for the julia programming language [](https://travis-ci.org/JuliaEditorSupport/julia-emacs) - [](https://melpa.org/#/julia-mode) # Installation
[nongnu] elpa/julia-mode 307b42b 189/352: If the previous line has a trailing =, that should take precedence over blocks.
branch: elpa/julia-mode commit 307b42b2d274302a0091607a196bf978edd3ded6 Author: Wilfred Hughes Commit: Yichao Yu If the previous line has a trailing =, that should take precedence over blocks. --- julia-mode.el | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index 0216279..afb18c8 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -364,13 +364,6 @@ before point. Returns nil if we're not within nested parens." (save-excursion (beginning-of-line) (ignore-errors (julia-paren-indent))) - ;; Indent according to how many nested blocks we are in. - (save-excursion -(beginning-of-line) -(forward-to-indentation 0) -(let ((endtok (julia-at-keyword julia-block-end-keywords))) - (ignore-errors (+ (julia-last-open-block (point-min)) -(if endtok (- julia-basic-offset) 0) ;; If the previous line ends in =, increase the indent. (ignore-errors ; if previous line is (point-min) (save-excursion @@ -381,6 +374,13 @@ before point. Returns nil if we're not within nested parens." (equal (char-after (point)) ?=))) (+ julia-basic-offset (current-indentation)) nil))) + ;; Indent according to how many nested blocks we are in. + (save-excursion +(beginning-of-line) +(forward-to-indentation 0) +(let ((endtok (julia-at-keyword julia-block-end-keywords))) + (ignore-errors (+ (julia-last-open-block (point-min)) +(if endtok (- julia-basic-offset) 0) ;; Otherwise, use the same indentation as previous line. (save-excursion (forward-line -1) (current-indentation))
[nongnu] elpa/julia-mode 569d41a 206/352: julia-mode.el: stagedfunction, @[no]inline, indented functions, "=:symbol"
branch: elpa/julia-mode commit 569d41a6a4249ee1e12a84f33c0136b08f637787 Author: Rafael Fourquet Commit: Yichao Yu julia-mode.el: stagedfunction, @[no]inline, indented functions, "=:symbol" --- julia-mode.el | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index e1974ca..c18fd2c 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -139,7 +139,8 @@ This function provides equivalent functionality, but makes no efforts to optimis ].* \\(in\\)\\(\\s-\\|$\\)+") (defconst julia-function-regex - (rx line-start symbol-start "function" + (rx line-start (* (or space "@inline" "@noinline")) symbol-start + (or "function" "stagedfunction") (1+ space) ;; Don't highlight module names in function declarations: (* (seq (1+ (or word (syntax symbol))) ".")) @@ -147,7 +148,7 @@ This function provides equivalent functionality, but makes no efforts to optimis (group (1+ (or word (syntax symbol)) (defconst julia-function-assignment-regex - (rx line-start symbol-start + (rx line-start (* (or space "@inline" "@noinline")) symbol-start (* (seq (1+ (or word (syntax symbol))) ".")) ; module name (group (1+ (or word (syntax symbol (* space) @@ -178,7 +179,7 @@ This function provides equivalent functionality, but makes no efforts to optimis (defconst julia-keyword-regex (julia--regexp-opt '("if" "else" "elseif" "while" "for" "begin" "end" "quote" - "try" "catch" "return" "local" "abstract" "function" "macro" "ccall" + "try" "catch" "return" "local" "abstract" "function" "stagedfunction" "macro" "ccall" "finally" "typealias" "break" "continue" "type" "global" "module" "using" "import" "export" "const" "let" "bitstype" "do" "in" "baremodule" "importall" "immutable") @@ -212,7 +213,7 @@ This function provides equivalent functionality, but makes no efforts to optimis (defconst julia-quoted-symbol-regex ;; :foo and :foo2 are valid, but :123 is not. - (rx (or whitespace "(" "[" ",") + (rx (or whitespace "(" "[" "," "=") (group ":" (or letter (syntax symbol)) (0+ (or word (syntax symbol)) (defconst julia-font-lock-keywords @@ -243,7 +244,7 @@ This function provides equivalent functionality, but makes no efforts to optimis )) (defconst julia-block-start-keywords - (list "if" "while" "for" "begin" "try" "function" "type" "let" "macro" + (list "if" "while" "for" "begin" "try" "function" "stagedfunction" "type" "let" "macro" "quote" "do" "immutable")) (defconst julia-block-end-keywords
[nongnu] elpa/julia-mode 6b7e956 321/352: Fix for derived parent mode (#66)
branch: elpa/julia-mode commit 6b7e956745a78df342e0e87a313dd4a91524df78 Author: yuhan0 Commit: Tamas K. Papp Fix for derived parent mode (#66) * Derive julia-mode directly from prog-mode Note: this drops compatibility with Emacs 23 and solves a bug with (derived-mode-p 'prog-mode) returning nil * Remove Emacs 23 compatibilty check for syntax-propertize-function --- julia-mode.el | 39 ++- 1 file changed, 10 insertions(+), 29 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index c0dfdb4..b6f7b53 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -367,14 +367,13 @@ Based on `python-syntax-stringify'." 'syntax-table (string-to-syntax "|")) (defconst julia-syntax-propertize-function - (unless (< emacs-major-version 24) -(syntax-propertize-rules - ("\"\"\"" - (0 (ignore (julia-stringify-triple-quote - (julia-char-regex - (1 "\"") ; Treat ' as a string delimiter. - (2 ".") ; Don't highlight anything between. - (3 "\"") ; Treat the last " in """ as a string delimiter. + (syntax-propertize-rules + ("\"\"\"" +(0 (ignore (julia-stringify-triple-quote + (julia-char-regex +(1 "\""); Treat ' as a string delimiter. +(2 ".") ; Don't highlight anything between. +(3 "\"" ; Treat the last " in """ as a string delimiter. (defun julia-in-comment (&optional syntax-ppss) "Return non-nil if point is inside a comment using SYNTAX-PPSS. @@ -635,11 +634,6 @@ meaning always increase indent on TAB and decrease on S-TAB." (when (>= point-offset 0) (move-to-column (+ (current-indentation) point-offset) -(defalias 'julia-mode-prog-mode - (if (fboundp 'prog-mode) - 'prog-mode -'fundamental-mode)) - ;;; Navigation ;; based off python.el @@ -781,27 +775,14 @@ Return nil if point is not in a function, otherwise point." )) ;;;###autoload -(define-derived-mode julia-mode julia-mode-prog-mode "Julia" +(define-derived-mode julia-mode prog-mode "Julia" "Major mode for editing julia code." (set-syntax-table julia-mode-syntax-table) (set (make-local-variable 'comment-start) "# ") (set (make-local-variable 'comment-start-skip) "#+\\s-*") (set (make-local-variable 'font-lock-defaults) '(julia-font-lock-keywords)) - (if (< emacs-major-version 24) - ;; Emacs 23 doesn't have syntax-propertize-function - (set (make-local-variable 'font-lock-syntactic-keywords) - (list -`(,julia-char-regex - (1 "\"") ; Treat ' as a string delimiter. - (2 ".") ; Don't highlight anything between the open and close '. - (3 "\"")) ; Treat the close ' as a string delimiter. -`(,julia-triple-quoted-string-regex - (1 "\""); Treat the first " in """ as a string delimiter. - (2 ".") ; Don't highlight anything between. - (3 "\"" ; Treat the last " in """ as a string delimiter. -;; Emacs 24 and later has syntax-propertize-function, so use that instead. -(set (make-local-variable 'syntax-propertize-function) - julia-syntax-propertize-function)) + (set (make-local-variable 'syntax-propertize-function) + julia-syntax-propertize-function) (set (make-local-variable 'indent-line-function) 'julia-indent-line) (set (make-local-variable 'beginning-of-defun-function) #'julia-beginning-of-defun) (set (make-local-variable 'end-of-defun-function) #'julia-end-of-defun)
[nongnu] elpa/julia-mode fabafad 200/352: julia-mode.el: improve matching of function assignment syntax
branch: elpa/julia-mode commit fabafadaa5af2861909393e4091b712f335043b9 Author: Rafael Fourquet Commit: Yichao Yu julia-mode.el: improve matching of function assignment syntax The case when a module qualification is prepended to the function name is handled like in normal function syntax, and support for one level of nested parentheses is added, e.g. M.f(x::(Int,)) = 1 (tuple types) or M.f(x, y=length(x)). --- julia-mode.el | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index 9cd4ae5..0ce07b4 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -148,11 +148,15 @@ This function provides equivalent functionality, but makes no efforts to optimis (defconst julia-function-assignment-regex (rx line-start symbol-start + (* (seq (1+ (or word (syntax symbol))) ".")) ; module name (group (1+ (or word (syntax symbol (* space) (? "{" (* (not (any "}"))) "}") (* space) - "(" (* (not (any ")"))) ")" + "(" (* (or + (seq "(" (* (not (any "(" ")"))) ")") + (not (any "(" ")" + ")" (* space) "="))
[nongnu] elpa/julia-mode fe6f6f7 348/352: Allow block indentation inside of parentheticals (#152)
branch: elpa/julia-mode commit fe6f6f7a80f8d60ecffa5b2cb43667bb9dc11705 Author: Colin Gilgenbach Commit: GitHub Allow block indentation inside of parentheticals (#152) * Allow block indentation inside of parentheticals * Style changes --- julia-mode-tests.el | 87 + julia-mode.el | 48 ++--- 2 files changed, 117 insertions(+), 18 deletions(-) diff --git a/julia-mode-tests.el b/julia-mode-tests.el index 72713f1..9befc9d 100644 --- a/julia-mode-tests.el +++ b/julia-mode-tests.el @@ -494,6 +494,93 @@ if c in ('\'') end ")) +(ert-deftest julia--test-indent-block-inside-paren () + "We should indent a block inside of a parenthetical." + (julia--should-indent " +variable = func( +arg1, +arg2, +if cond +statement() +arg3 +else +arg3 +end, +arg4 +)" " +variable = func( +arg1, +arg2, +if cond +statement() +arg3 +else +arg3 +end, +arg4 +)")) + +(ert-deftest julia--test-indent-block-inside-hanging-paren () + "We should indent a block inside of a hanging parenthetical." + (julia--should-indent " +variable = func(arg1, +arg2, +if cond +statement() +arg3 +else +arg3 +end, +arg4 +)" " +variable = func(arg1, +arg2, +if cond +statement() +arg3 +else +arg3 +end, +arg4 +)")) + +(ert-deftest julia--test-indent-nested-block-inside-paren () + "We should indent a nested block inside of a parenthetical." + (julia--should-indent " +variable = func( +arg1, +if cond1 +statement() +if cond2 +statement() +end +arg3 +end, +arg4 +)" " +variable = func( +arg1, +if cond1 +statement() +if cond2 +statement() +end +arg3 +end, +arg4 +)")) + +(ert-deftest julia--test-indent-block-next-to-paren () + (julia--should-indent " +var = func(begin +test +end +)" " +var = func(begin + test + end + )")) + ;;; font-lock tests (ert-deftest julia--test-symbol-font-locking-at-bol () diff --git a/julia-mode.el b/julia-mode.el index 377c9ce..a8f8e78 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -459,7 +459,19 @@ Do not move back beyond MIN." (and pos (progn (goto-char pos) - (+ julia-indent-offset (current-indentation)) + (+ julia-indent-offset (julia-block-open-indentation)) + +(defun julia-block-open-indentation () + "Get the current indentation or the start of a parenthetical block." + (save-excursion +(save-restriction + ;; narrow to one line to only search syntax on that line + (narrow-to-region (line-beginning-position) (line-end-position)) +(condition-case nil +(progn + (backward-up-list) + (1+ (current-column))) + (error (current-indentation)) (defcustom julia-max-block-lookback 2 "When indenting, don't look back more than this many characters @@ -585,27 +597,27 @@ meaning always increase indent on TAB and decrease on S-TAB." ;; note: if this first function returns nil the beginning of the line ;; cannot be in a string (julia-indent-in-string) - ;; If we're inside an open paren, indent to line up arguments. After this, - ;; we cannot be inside parens which includes brackets - (julia-paren-indent) ;; indent due to hanging operators (lines ending in an operator) (julia-indent-hanging) ;; indent for import and export (julia-indent-import-export-using) - ;; Indent according to how many nested blocks we are in. - (save-excursion -(beginning-of-line) -;; jump out of any comments -(let ((state (syntax-ppss))) - (when (nth 4 state) -(goto-char (nth 8 state -(forward-to-indentation 0) -(let ((endtok (julia-at-keyword julia-block-end-keywords)) - (last-open-block (julia-last-open-block (- (point) julia-max-block-lookback - (max 0 (+ (or last-open-block 0) -(if (or endtok -(julia-at-keyword julia-block-start-keywords-no-indent)) -(- julia-indent-offset) 0))) + ;; use julia-paren-indent along with block indentation + (let ((paren-indent (or (julia-paren-indent) 0))) +;; Indent according to how many nested blocks we are in. +(save-excursion + (beginning-of-line) + ;; jump out of any comments + (let ((state (syntax-ppss))) +(when (nth 4 state) + (goto-char (nth 8 state + (forward-to-indentation 0) + (let ((endtok (julia-at-keyword julia-block-end-keywords)) +(last-open-block (julia-last-open-block (- (point) julia-max-block-lookback +(max paren
[nongnu] elpa/julia-mode f378cbc 208/352: Mailmap update.
branch: elpa/julia-mode commit f378cbc30253426b3bf270f562a2d7a112fb28a4 Author: Viral B. Shah Commit: Yichao Yu Mailmap update. --- .mailmap | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.mailmap b/.mailmap index 0fedc25..1ad0a33 100644 --- a/.mailmap +++ b/.mailmap @@ -182,3 +182,5 @@ Tracy Wadleigh Tracy Wadleigh Mike Innes + +Sean Garborg
[nongnu] elpa/julia-mode 8bfc709 325/352: bump version for release
branch: elpa/julia-mode commit 8bfc709716a257521cb386f20b8932e83db930a9 Author: Tamas K. Papp Commit: Tamas K. Papp bump version for release version in source was already 0.4 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 441e358..930c5ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Unreleased +# 0.4 + - increase lookback ([#98](https://github.com/JuliaEditorSupport/julia-emacs/pull/98)), fixes [#5](https://github.com/JuliaEditorSupport/julia-emacs/issues/5) - fix derived parent mode ([#66](https://github.com/JuliaEditorSupport/julia-emacs/pull/66))
[nongnu] elpa/julia-mode 4b41b85 207/352: julia-mode.el: `f(x) == something` does not define a function
branch: elpa/julia-mode commit 4b41b85f058c2ea2ceaa9a9b050e8c4dac9556fa Author: Rafael Fourquet Commit: Yichao Yu julia-mode.el: `f(x) == something` does not define a function --- julia-mode.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index c18fd2c..d3d5a2a 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -159,7 +159,8 @@ This function provides equivalent functionality, but makes no efforts to optimis (not (any "(" ")" ")" (* space) - "=")) + "=" + (not (any "=" (defconst julia-type-regex (rx symbol-start (or "immutable" "type" "abstract") (1+ space) (group (1+ (or word (syntax symbol))
[nongnu] elpa/nasm-mode ad2ff83 05/67: Add .gitignore.
branch: elpa/nasm-mode commit ad2ff83df5245953ad382df85d917817ea58a269 Author: Christopher Wellons Commit: Christopher Wellons Add .gitignore. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore new file mode 100644 index 000..c531d98 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.elc
[nongnu] elpa/julia-mode d91f1d0 324/352: Remove regexp-opt workarounds for Emacs < 24 (#101)
branch: elpa/julia-mode commit d91f1d082ade8ac6e42d4943cd183d6087c3cf19 Author: Adam B Commit: GitHub Remove regexp-opt workarounds for Emacs < 24 (#101) # Add explicit dependency on Emacs 24.3 Emacs 24.3 at least is needed for `cl-lib`. Also clean up some other headers. # Remove regexp-opt workarounds for Emacs < 24 Since `julia-mode` no longer supports Emacs 23, we can directly call `regexp-opt` instead of wrapping it inefficiently. For Emacs 24+, this commit makes no functional change. # Remove some internal aliases Remove some convenience aliases which may break user's configs, but they should not have been included outside the `julia-` namespace in the first place. --- CHANGELOG.md | 4 +++- julia-mode.el | 47 --- 2 files changed, 15 insertions(+), 36 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17e5bff..441e358 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,9 @@ - load LaTeX substitution table as a feature ([#93](https://github.com/JuliaEditorSupport/julia-emacs/pull/93)) -- drop support for Emacs 23, use `cl-lib` ([#87](https://github.com/JuliaEditorSupport/julia-emacs/pull/87)), reorganize test framework accordingly ([#95](https://github.com/JuliaEditorSupport/julia-emacs/pull/95)) +- drop support for Emacs earlier than 24.3, use `cl-lib` ([#87](https://github.com/JuliaEditorSupport/julia-emacs/pull/87)), reorganize test framework accordingly ([#95](https://github.com/JuliaEditorSupport/julia-emacs/pull/95)) + +- remove `latexsub` alias for `julia-latexsub` [#101](https://github.com/JuliaEditorSupport/julia-emacs/pull/101) # 0.3 diff --git a/julia-mode.el b/julia-mode.el index 22acc6f..112db64 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -1,9 +1,10 @@ ;;; julia-mode.el --- Major mode for editing Julia source code -*- lexical-binding: t -*- -;; Copyright (C) 2009-2014 Julia contributors -;; URL: https://github.com/JuliaLang/julia +;; Copyright (C) 2009-2014 Julia contributors, 2015-2020 julia-mode contributors +;; URL: https://github.com/JuliaEditorSupport/julia-emacs ;; Version: 0.4 ;; Keywords: languages +;; Package-Requires: ((emacs "24.3")) ;;; Usage: ;; Put the following code in your .emacs, site-load.el, or other relevant file @@ -64,24 +65,6 @@ ;;;###autoload (add-to-list 'auto-mode-alist '("\\.jl\\'" . julia-mode)) -;; define ignore-errors macro if it isn't present -;; (necessary for emacs 22 compatibility) -(when (not (fboundp 'ignore-errors)) - (defmacro ignore-errors (body) `(condition-case nil ,body (error nil - -(defun julia--regexp-opt (strings &optional paren) - "Emacs 23 provides `regexp-opt', but it does not support PAREN taking the value 'symbols. -This function provides equivalent functionality, but makes no efforts to optimise the regexp." - (cond - ((>= emacs-major-version 24) -(regexp-opt strings paren)) - ((not (eq paren 'symbols)) -(regexp-opt strings paren)) - ((null strings) -"") - ('t -(rx-to-string `(seq symbol-start (or ,@strings) symbol-end) - (defvar julia-mode-syntax-table (let ((table (make-syntax-table))) (modify-syntax-entry ?_ "_" table) @@ -259,7 +242,7 @@ This function provides equivalent functionality, but makes no efforts to optimis (rx symbol-start (group "@" (1+ (or word (syntax symbol)) (defconst julia-keyword-regex - (julia--regexp-opt + (regexp-opt '("if" "else" "elseif" "while" "for" "begin" "end" "quote" "try" "catch" "return" "local" "function" "macro" "ccall" "finally" "break" "continue" "global" "where" @@ -271,13 +254,13 @@ This function provides equivalent functionality, but makes no efforts to optimis 'symbols)) (defconst julia-builtin-regex - (julia--regexp-opt + (regexp-opt ;;'("error" "throw") '() 'symbols)) (defconst julia-builtin-types-regex - (julia--regexp-opt + (regexp-opt '("Number" "Real" "BigInt" "Integer" "UInt" "UInt8" "UInt16" "UInt32" "UInt64" "UInt128" "Int" "Int8" "Int16" "Int32" "Int64" "Int128" @@ -294,8 +277,7 @@ This function provides equivalent functionality, but makes no efforts to optimis "AbstractRange" "OrdinalRange" "StepRange" "UnitRange" "FloatRange" "Tuple" "NTuple" "Vararg" "DataType" "Symbol" "Function" "Vector" "Matrix" "Union" "Type" "Any" "Complex" "AbstractString" "Ptr" "Nothing" "Exception" "Task" "Signed" "Unsigned" "AbstractDict" "Dict" "IO" "IOStream" "Rational" "Regex" "RegexMatch" "Set" "BitSet" "Expr" "WeakRef" "ObjectIdDict" - "AbstractRNG" "MersenneTwister" - ) + "AbstractRNG" "MersenneTwister") 'symbols)) (defconst julia-quoted-symbol-regex @@ -315,7 +297,7 @@ This function provides equivalent functionality, but makes no efforts to optimis (cons julia-keyword-regex 'font-lock-keyword-face) (cons julia-macro-regex ''julia-macro-face) (cons -(julia--regexp-op
[nongnu] elpa/julia-mode c7e3232 218/352: some tuple redesign follow-ups
branch: elpa/julia-mode commit c7e3232a198c1210c3eca0846485836e187c6947 Author: Jeff Bezanson Commit: Yichao Yu some tuple redesign follow-ups - add news item - remove `, ...` syntax, for now use `Vararg{}` instead - allow tuples of types in reflection functions - a couple efficiency tweaks --- julia-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index ce413e1..2ba71de 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -209,7 +209,7 @@ This function provides equivalent functionality, but makes no efforts to optimis "Char" "ASCIIString" "UTF8String" "ByteString" "SubString" "Array" "DArray" "AbstractArray" "AbstractVector" "AbstractMatrix" "AbstractSparseMatrix" "SubArray" "StridedArray" "StridedVector" "StridedMatrix" "VecOrMat" "StridedVecOrMat" "DenseArray" "SparseMatrixCSC" "BitArray" "Range" "OrdinalRange" "StepRange" "UnitRange" "FloatRange" - "Tuple" "NTuple" + "Tuple" "NTuple" "Vararg" "DataType" "Symbol" "Function" "Vector" "Matrix" "Union" "Type" "Any" "Complex" "String" "Ptr" "Void" "Exception" "Task" "Signed" "Unsigned" "Associative" "Dict" "IO" "IOStream" "Rational" "Regex" "RegexMatch" "Set" "IntSet" "Expr" "WeakRef" "ObjectIdDict" "AbstractRNG" "MersenneTwister" )
[nongnu] elpa/julia-mode 11e3904 176/352: Backporting regexp-opt functionality to Emacs 23.
branch: elpa/julia-mode commit 11e3904af277157166ff62552e76ae4aa31c50b2 Author: Wilfred Hughes Commit: Yichao Yu Backporting regexp-opt functionality to Emacs 23. See https://github.com/JuliaLang/julia/issues/8537 --- julia-mode.el | 57 +++-- 1 file changed, 35 insertions(+), 22 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index a41aba7..d67b028 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -47,6 +47,19 @@ (when (not (fboundp 'ignore-errors)) (defmacro ignore-errors (body) `(condition-case nil ,body (error nil +(defun julia--regexp-opt (strings &optional paren) + "Emacs 23 provides `regexp-opt', but it does not support PAREN taking the value 'symbols. +This function provides equivalent functionality, but makes no efforts to optimise the regexp." + (cond + ((>= emacs-major-version 24) +(regexp-opt strings paren)) + ((not (eq paren 'symbols)) +(regexp-opt strings paren)) + ((null strings) +"") + ('t +(rx-to-string `(seq symbol-start (or ,@strings) symbol-end) + (defvar julia-mode-syntax-table (let ((table (make-syntax-table))) (modify-syntax-entry ?_ "_" table) @@ -140,7 +153,7 @@ (rx symbol-start (group "@" (1+ (or word (syntax symbol)) (defconst julia-keyword-regex - (regexp-opt + (julia--regexp-opt '("if" "else" "elseif" "while" "for" "begin" "end" "quote" "try" "catch" "return" "local" "abstract" "function" "macro" "ccall" "finally" "typealias" "break" "continue" "type" "global" @@ -149,13 +162,13 @@ 'symbols)) (defconst julia-builtin-regex - (regexp-opt + (julia--regexp-opt ;;'("error" "throw") '() 'symbols)) (defconst julia-builtin-types-regex - (regexp-opt + (julia--regexp-opt '("Number" "Real" "BigInt" "Integer" "Uint" "Uint8" "Uint16" "Uint32" "Uint64" "Uint128" "Int" "Int8" "Int16" "Int32" "Int64" "Int128" @@ -171,25 +184,25 @@ (defconst julia-font-lock-keywords (list -(cons julia-builtin-types-regex 'font-lock-type-face) -(cons julia-keyword-regex 'font-lock-keyword-face) -(cons julia-macro-regex 'font-lock-keyword-face) -(cons - (regexp-opt - '("true" "false" "C_NULL" "Inf" "NaN" "Inf32" "NaN32" "nothing") - 'symbols) - 'font-lock-constant-face) -(list julia-unquote-regex 2 'font-lock-constant-face) -(list julia-char-regex 2 'font-lock-string-face) -(list julia-forloop-in-regex 1 'font-lock-keyword-face) -(list julia-function-regex 1 'font-lock-function-name-face) -(list julia-function-assignment-regex 1 'font-lock-function-name-face) -(list julia-type-regex 1 'font-lock-type-face) -(list julia-type-annotation-regex 1 'font-lock-type-face) -;;(list julia-type-parameter-regex 1 'font-lock-type-face) -(list julia-subtype-regex 1 'font-lock-type-face) -(list julia-builtin-regex 1 'font-lock-builtin-face) -)) + (cons julia-builtin-types-regex 'font-lock-type-face) + (cons julia-keyword-regex 'font-lock-keyword-face) + (cons julia-macro-regex 'font-lock-keyword-face) + (cons +(julia--regexp-opt + '("true" "false" "C_NULL" "Inf" "NaN" "Inf32" "NaN32" "nothing") + 'symbols) +'font-lock-constant-face) + (list julia-unquote-regex 2 'font-lock-constant-face) + (list julia-char-regex 2 'font-lock-string-face) + (list julia-forloop-in-regex 1 'font-lock-keyword-face) + (list julia-function-regex 1 'font-lock-function-name-face) + (list julia-function-assignment-regex 1 'font-lock-function-name-face) + (list julia-type-regex 1 'font-lock-type-face) + (list julia-type-annotation-regex 1 'font-lock-type-face) + ;;(list julia-type-parameter-regex 1 'font-lock-type-face) + (list julia-subtype-regex 1 'font-lock-type-face) + (list julia-builtin-regex 1 'font-lock-builtin-face) + )) (defconst julia-block-start-keywords (list "if" "while" "for" "begin" "try" "function" "type" "let" "macro"
[nongnu] elpa/julia-mode dd3d682 225/352: Fix Emacs 23 error.
branch: elpa/julia-mode commit dd3d6825d667cf8eafe4d860b2c64d80ec6e5030 Author: Wilfred Hughes Commit: Yichao Yu Fix Emacs 23 error. This constant is only used in Emacs 24+, and `syntax-propertize-rules` is not defined in Emacs 23. --- julia-mode.el | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index 7cf2f56..916a274 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -278,14 +278,15 @@ Based on `python-syntax-stringify'." (put-text-property string-start-pos (1+ string-start-pos) 'syntax-table (string-to-syntax "|")) -(defconst julia-syntax-propertize-function - (syntax-propertize-rules - ("\"\"\"" -(0 (ignore (julia-stringify-triple-quote - (julia-char-regex -(1 "\"") ; Treat ' as a string delimiter. -(2 ".") ; Don't highlight anything between. -(3 "\"" ; Treat the last " in """ as a string delimiter. +(unless (< emacs-major-version 24) + (defconst julia-syntax-propertize-function +(syntax-propertize-rules + ("\"\"\"" + (0 (ignore (julia-stringify-triple-quote + (julia-char-regex + (1 "\"") ; Treat ' as a string delimiter. + (2 ".") ; Don't highlight anything between. + (3 "\"") ; Treat the last " in """ as a string delimiter. (defun julia-in-comment () "Return non-nil if point is inside a comment.
[nongnu] elpa/julia-mode d69b095 342/352: Removed require statement for auctex that broke prettify. Fixes #99 (#116)
branch: elpa/julia-mode commit d69b0956ae19e9b9420c314b6f31d6b94e19ecec Author: Matthew Blackwell Commit: GitHub Removed require statement for auctex that broke prettify. Fixes #99 (#116) --- julia-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index 287b4c3..424bdff 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -773,7 +773,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)
[nongnu] elpa/julia-mode ff8adf5 221/352: Add tests for #11684. [ci skip]
branch: elpa/julia-mode commit ff8adf5316224ef57c100a708185866f13965102 Author: Yichao Yu Commit: Yichao Yu Add tests for #11684. [ci skip] --- julia-mode.el | 12 1 file changed, 12 insertions(+) diff --git a/julia-mode.el b/julia-mode.el index 407c8b6..31c2df8 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -542,6 +542,18 @@ if foo bar end")) + (ert-deftest julia--test-indent-comment-equal () +"`=` at the end of comment should not increase indent level." +(julia--should-indent + " +# a = +# b = +c" + " +# a = +# b = +c")) + (defun julia--run-tests () (interactive) (ert-run-tests-interactively "julia--test")))
[nongnu] elpa/nasm-mode 23cb9de 20/67: Add imenu support for macro definitions.
branch: elpa/nasm-mode commit 23cb9de0e66479ca5a88397a4ebba3b2eef1cfc2 Author: Christopher Wellons Commit: Christopher Wellons Add imenu support for macro definitions. --- nasm-mode.el | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/nasm-mode.el b/nasm-mode.el index 80a4964..a58cdf8 100644 --- a/nasm-mode.el +++ b/nasm-mode.el @@ -407,6 +407,12 @@ "\\<$?[-+0-9][-+_0-9A-Fa-fHhXxDdTtQqOoBbYyeE.]*\\>" "Regexp for `nasm-mode' for matching numeric constants.") +(defconst nasm-imenu-generic-expression + `((nil ,(concat "^\\s-*" nasm-label-regexp) 1) +(nil ,(concat (regexp-opt '("%define" "%macro") 'words) + "\\s-+\\([a-zA-Z0-9_$#@~.?]+\\)") 2)) + "Expressions for `imenu-generic-expression'.") + (defconst nasm-font-lock-keywords `(("\\<\\.[a-zA-Z0-9_$#@~.?]+\\>" . font-lock-type-face) (,(regexp-opt nasm-registers 'words) . font-lock-variable-name-face) @@ -422,6 +428,8 @@ (let ((table (make-syntax-table))) (prog1 table (modify-syntax-entry ?_ "w" table) + (modify-syntax-entry ?# "w" table) + (modify-syntax-entry ?@ "w" table) (modify-syntax-entry ?\. "w" table) (modify-syntax-entry ?\? "w" table) (modify-syntax-entry ?# "w" table) @@ -474,8 +482,8 @@ (setf font-lock-defaults '(nasm-font-lock-keywords nil :case-fold) indent-line-function #'nasm-indent-line comment-start ";" -imenu-generic-expression -`((nil ,(concat "^\\s-*" nasm-label-regexp) 1 +imenu-generic-expression nasm-imenu-generic-expression)) + (provide 'nasm-mode)
[nongnu] elpa/julia-mode 2e72a0b 213/352: Removed (setq comint-proccess-echoes t) from contrib/julia-mode.el
branch: elpa/julia-mode commit 2e72a0b5d355daf1be6363e618f3a3e4e1b6778b Author: Philip Woods Commit: Yichao Yu Removed (setq comint-proccess-echoes t) from contrib/julia-mode.el --- julia-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index e360e05..2b2094e 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -3120,7 +3120,6 @@ end")) (defun inferior-julia--initialize () "Helper function to initialize `inferior-julia'." -(setq comint-process-echoes t) (setq comint-use-prompt-regexp t)) (define-derived-mode inferior-julia-mode comint-mode "Julia" @@ -3130,6 +3129,7 @@ end")) (setq comint-prompt-read-only t) (set (make-local-variable 'font-lock-defaults) '(julia-font-lock-keywords t)) (set (make-local-variable 'paragraph-start) inferior-julia-prompt-regexp) + (set (make-local-variable 'indent-line-function) 'julia-indent-line) (set-input-method "TeX")) (add-hook 'inferior-julia-mode-hook 'inferior-julia--initialize)
[nongnu] elpa/julia-mode 7c1603c 226/352: Use more common name for indentation setting
branch: elpa/julia-mode commit 7c1603c37f38b27d0247fca18cf0280b8b6e2375 Author: Marten Lienen Commit: Yichao Yu Use more common name for indentation setting --- julia-mode.el | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index 916a274..401f84e 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -42,7 +42,7 @@ (defvar julia-mode-hook nil) -(defvar julia-basic-offset) +(defvar julia-indent-offset) (defface julia-macro-face '((t :inherit font-lock-preprocessor-face)) @@ -367,7 +367,7 @@ Do not move back beyond MIN." (and pos (progn (goto-char pos) - (+ julia-basic-offset (current-indentation)) + (+ julia-indent-offset (current-indentation)) (defsubst julia--safe-backward-char () "Move back one character, but don't error if we're at the @@ -436,7 +436,7 @@ with it. Returns nil if we're not within nested parens." (end-of-line) (backward-char 1) (and (equal (char-after (point)) ?=) (not (julia-in-comment) - (+ julia-basic-offset (current-indentation)) + (+ julia-indent-offset (current-indentation)) nil))) ;; Indent according to how many nested blocks we are in. (save-excursion @@ -444,7 +444,7 @@ with it. Returns nil if we're not within nested parens." (forward-to-indentation 0) (let ((endtok (julia-at-keyword julia-block-end-keywords))) (ignore-errors (+ (julia-last-open-block (- (point) julia-max-block-lookback)) -(if endtok (- julia-basic-offset) 0) +(if endtok (- julia-indent-offset) 0) ;; Otherwise, use the same indentation as previous line. (save-excursion (forward-line -1) (current-indentation)) @@ -655,7 +655,7 @@ c")) (set (make-local-variable 'syntax-propertize-function) julia-syntax-propertize-function)) (set (make-local-variable 'indent-line-function) 'julia-indent-line) - (set (make-local-variable 'julia-basic-offset) 4) + (set (make-local-variable 'julia-indent-offset) 4) (setq indent-tabs-mode nil) (setq imenu-generic-expression julia-imenu-generic-expression) (imenu-add-to-menubar "Imenu"))
[nongnu] elpa/julia-mode 0eec10a 333/352: Do not consider `:end` as block ending
branch: elpa/julia-mode commit 0eec10a93a32d10a0f7402cab6d3958b2ae3962c Author: Ronan Arraes Jardim Chagas Commit: Ronan Arraes Jardim Chagas Do not consider `:end` as block ending The word `:end` was being considered as a block ending. Hence, the following code: if a == :end r = 1 end was being incorrectly indented: if a == :end r = 1 end Closes #122 --- julia-mode-tests.el | 10 ++ julia-mode.el | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/julia-mode-tests.el b/julia-mode-tests.el index 8ca4299..6d326a9 100644 --- a/julia-mode-tests.el +++ b/julia-mode-tests.el @@ -433,6 +433,16 @@ function( i=1:2 ) end end") +(ert-deftest julia--test-indent-ignore-:end-as-block-ending () + "Do not consider `:end` as a block ending." + (julia--should-indent + "if a == :end +r = 1 +end" + "if a == :end +r = 1 +end")) + (ert-deftest julia--test-symbol-font-locking-at-bol () "Symbols get font-locked at beginning or line." (julia--should-font-lock diff --git a/julia-mode.el b/julia-mode.el index 2282bab..d9bb6c3 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -412,7 +412,9 @@ Do not move back beyond position MIN." (cond ((julia-at-keyword julia-block-start-keywords) (+ nesting-count 1)) ((and (equal (current-word t) "end") - (not (julia-in-comment))) + (not (julia-in-comment)) + ;; Do not consider the symbol `:end` a block ending. + (not (equal (char-before (point)) ?:))) (- nesting-count 1)) (t nesting-count (if (> nesting-count 0)
[nongnu] elpa/julia-mode 0c6673a 212/352: Changed input method for Julia Emacs buffer to TeX
branch: elpa/julia-mode commit 0c6673a1c7a2e0de1f8bfdd13e61d8de1838ef82 Author: Philip Woods Commit: Yichao Yu Changed input method for Julia Emacs buffer to TeX --- julia-mode.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/julia-mode.el b/julia-mode.el index a206929..e360e05 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -3129,7 +3129,8 @@ end")) (setq comint-prompt-regexp inferior-julia-prompt-regexp) (setq comint-prompt-read-only t) (set (make-local-variable 'font-lock-defaults) '(julia-font-lock-keywords t)) - (set (make-local-variable 'paragraph-start) inferior-julia-prompt-regexp)) + (set (make-local-variable 'paragraph-start) inferior-julia-prompt-regexp) + (set-input-method "TeX")) (add-hook 'inferior-julia-mode-hook 'inferior-julia--initialize)
[nongnu] elpa/julia-mode dc17943 351/352: Indent imports from submodule correctly (#154)
branch: elpa/julia-mode commit dc1794335bb584b5937e995d61ad4732f06dcd5a Author: David Hanak Commit: GitHub Indent imports from submodule correctly (#154) * Indent using/import from submodules correctly * Add changelog entry --- CHANGELOG.md| 2 ++ julia-mode-tests.el | 9 + julia-mode.el | 2 ++ 3 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 856dabe..5aa25dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Unreleased +- fix indentation of submodule imports + # 0.4 - increase lookback ([#98](https://github.com/JuliaEditorSupport/julia-emacs/pull/98)), fixes [#5](https://github.com/JuliaEditorSupport/julia-emacs/issues/5) diff --git a/julia-mode-tests.el b/julia-mode-tests.el index bb4af97..72314a6 100644 --- a/julia-mode-tests.el +++ b/julia-mode-tests.el @@ -390,6 +390,15 @@ notpartofit" "using Foo: bar , baz, quux +notpartofit") + (julia--should-indent + "using Foo.Bar: bar , +baz, +quux +notpartofit" + "using Foo.Bar: bar , +baz, +quux notpartofit")) (ert-deftest julia--test-indent-anonymous-function () diff --git a/julia-mode.el b/julia-mode.el index a8f8e78..04437f7 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -428,6 +428,8 @@ symbol, gives up when this is not true." (setf module (match-string-no-properties 1 ((looking-at (rx (* (or word (syntax symbol))) (0+ space) ",")) (when module (setf done 'broken))) + ((looking-at (rx (* (or word (syntax symbol))) ".")) + (setf module (concat (match-string-no-properties 0) module))) (t (setf done 'broken) (if (eq done 'broken) nil
[nongnu] elpa/julia-mode a37d541 214/352: Changed input from TeX mode to use Julia unicode input
branch: elpa/julia-mode commit a37d541dfb7707c25163c0b6333a0019c16d6a36 Author: Philip Woods Commit: Yichao Yu Changed input from TeX mode to use Julia unicode input --- julia-mode.el | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index 2b2094e..6ccb2cf 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -3105,6 +3105,13 @@ end")) (defvar julia-arguments '() "Commandline arguments to pass to `julia'.") +(defvar inferior-julia-mode-map + (let ((map (nconc (make-sparse-keymap) comint-mode-map))) +;; example definition +(define-key map (kbd "TAB") 'julia-latexsub-or-indent) +map) + "Basic mode map for `inferior-julia-mode'.") + (defvar inferior-julia-prompt-regexp "julia>" "Prompt for `inferior-julia'.") @@ -3123,14 +3130,15 @@ end")) (setq comint-use-prompt-regexp t)) (define-derived-mode inferior-julia-mode comint-mode "Julia" - "Major mode for `inferior-julia'." + "Major mode for `inferior-julia'. + +\\" nil "Julia" (setq comint-prompt-regexp inferior-julia-prompt-regexp) (setq comint-prompt-read-only t) (set (make-local-variable 'font-lock-defaults) '(julia-font-lock-keywords t)) (set (make-local-variable 'paragraph-start) inferior-julia-prompt-regexp) - (set (make-local-variable 'indent-line-function) 'julia-indent-line) - (set-input-method "TeX")) + (set (make-local-variable 'indent-line-function) 'julia-indent-line)) (add-hook 'inferior-julia-mode-hook 'inferior-julia--initialize)