[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/julia-mode e4d0e09 199/352: Highlight quoted symbols, e.g.
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/julia-mode e4d0e09 199/352: Highlight quoted symbols, e.g. :foo. |
Date: |
Sun, 29 Aug 2021 11:22:44 -0400 (EDT) |
branch: elpa/julia-mode
commit e4d0e0919e5fca9d87fd6ee536cdcf0d4c86dc74
Author: Wilfred Hughes <me@wilfred.me.uk>
Commit: Yichao Yu <yyc1992@gmail.com>
Highlight quoted symbols, e.g. :foo.
Fixes https://github.com/JuliaLang/julia/issues/8713.
---
julia-mode.el | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/julia-mode.el b/julia-mode.el
index 7bb8676..9cd4ae5 100644
--- a/julia-mode.el
+++ b/julia-mode.el
@@ -46,6 +46,11 @@
"Face for Julia macro invocations."
:group 'julia-mode)
+(defface julia-quoted-symbol-face
+ '((t :inherit font-lock-preprocessor-face))
+ "Face for quoted Julia symbols, e.g. :foo."
+ :group 'julia-mode)
+
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.jl\\'" . julia-mode))
@@ -196,8 +201,19 @@ This function provides equivalent functionality, but makes
no efforts to optimis
"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")
'symbols))
+(defconst julia-quoted-symbol-regex
+ ;; :foo and :foo2 are valid, but :123 is not.
+ (rx (or whitespace "(" "[" ",")
+ (group ":" (or letter (syntax symbol)) (0+ (or word (syntax symbol))))))
+
(defconst julia-font-lock-keywords
(list
+ ;; Ensure :: and <: aren't highlighted, so we don't confuse ::Foo with :foo.
+ ;; (in Emacs, keywords don't overlap).
+ (cons (rx (or "::" "<:")) ''default)
+ ;; Highlight quoted symbols before keywords, so :function is not
+ ;; highlighted as a keyword.
+ (list julia-quoted-symbol-regex 1 ''julia-quoted-symbol-face)
(cons julia-builtin-types-regex 'font-lock-type-face)
(cons julia-keyword-regex 'font-lock-keyword-face)
(cons julia-macro-regex ''julia-macro-face)
- [nongnu] elpa/julia-mode 47ad8e4 158/352: add 1607 new LaTeX tab completions from the unicode-math package (closes #7657), (continued)
- [nongnu] elpa/julia-mode 47ad8e4 158/352: add 1607 new LaTeX tab completions from the unicode-math package (closes #7657), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 0b96ff5 170/352: Revert "Update .mailmap", ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode d74b8a3 171/352: Use the syntax table to detect if point is in a comment., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 747176f 177/352: fix latex symbol \bot, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode faee243 179/352: Implementing julia-in-string and julia-in-char., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode ab58fb7 193/352: Update mailmap, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 96d6597 194/352: Fixing highlighting of long character escape sequences., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode ca2fe4b 195/352: Removing julia-in-char., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode ea54e19 196/352: Fontify strings and chars as strings, not keywords., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 80c6754 197/352: Silencing byte-compiler warning., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode e4d0e09 199/352: Highlight quoted symbols, e.g. :foo.,
ELPA Syncer <=
- [nongnu] elpa/julia-mode 4b22a79 205/352: julia-mode.el: remove types that are removed or deprecated, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode f84a425 219/352: Clean up stagedfunction, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode f378cbc 208/352: Mailmap update., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode f3b490b 210/352: Added inferior-julia comint mode, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 8dd023d 223/352: julia-paren-indent: docstring, test, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 8d6ea60 233/352: Fix #11549 (top level after paren-indented line), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 9cbde7b 236/352: julia-mode: Move tests to new file and improve, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 1f06e85 234/352: Alias `run-julia` to `inferior-julia` in julia-mode.el, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode a82e629 239/352: julia-mode: Indent manually inside strings with \n, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 1746c4b 238/352: julia-mode: Improve paren indent perf, ELPA Syncer, 2021/08/29