[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/julia-mode d74b8a3 171/352: Use the syntax table to detect
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/julia-mode d74b8a3 171/352: Use the syntax table to detect if point is in a comment. |
Date: |
Sun, 29 Aug 2021 11:22:38 -0400 (EDT) |
branch: elpa/julia-mode
commit d74b8a311c4eac92bea3a3998343e02711d54f1f
Author: Wilfred Hughes <me@wilfred.me.uk>
Commit: Yichao Yu <yyc1992@gmail.com>
Use the syntax table to detect if point is in a comment.
This fixes #8538, where `julia-comment-open` was getting confused by
strings inside comments.
It also generalises `julia-in-comment` to handle multi-line comments.
---
julia-mode.el | 20 +++-----------------
1 file changed, 3 insertions(+), 17 deletions(-)
diff --git a/julia-mode.el b/julia-mode.el
index d3932ce..cb66002 100644
--- a/julia-mode.el
+++ b/julia-mode.el
@@ -189,24 +189,10 @@
(or (equal item (car lst))
(julia-member item (cdr lst)))))
-(if (not (fboundp 'evenp))
- (defun evenp (x) (zerop (% x 2))))
-
-(defun julia-find-comment-open (p0)
- (if (< (point) p0)
- nil
- (if (and (equal (char-after (point)) ?#)
- (evenp (julia-strcount
- (buffer-substring p0 (point)) ?\")))
- t
- (if (= (point) p0)
- nil
- (progn (backward-char 1)
- (julia-find-comment-open p0))))))
-
(defun julia-in-comment ()
- (save-excursion
- (julia-find-comment-open (line-beginning-position))))
+ "Return non-nil if point is inside a comment.
+Handles both single-line and multi-line comments."
+ (nth 4 (syntax-ppss)))
(defun julia-strcount (str chr)
(let ((i 0)
- [nongnu] elpa/julia-mode d2bd57d 139/352: Update mailmap, (continued)
- [nongnu] elpa/julia-mode d2bd57d 139/352: Update mailmap, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode cc5e1fe 135/352: tab-substitution of LaTeX symbols in Emacs julia-mode (for #6340, based on #6911), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 5144c31 149/352: Highlight types in all type annotations., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 3caccea 148/352: `in` is a keyword, so highlight it., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 6105b93 151/352: Header improvements to conform to MELPA's standards., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 8442201 152/352: All julia functions and variables should be prefixed., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 662e153 169/352: Update .mailmap, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode e4f0b02 167/352: Ensure ! in a macro invocation is highlighted correctly., ELPA Syncer, 2021/08/29
- [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 <=
- [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, 2021/08/29
- [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