[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/zig-mode c5315ff 026/104: Apply font-lock-doc-face to doc
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/zig-mode c5315ff 026/104: Apply font-lock-doc-face to doc comments (for issue #5) |
Date: |
Sun, 29 Aug 2021 11:36:56 -0400 (EDT) |
branch: elpa/zig-mode
commit c5315ff33668d1f545c83242f81e0a6a2f5c7959
Author: Matthew D. Steele <mdsteele@alum.mit.edu>
Commit: Matthew D. Steele <mdsteele@alum.mit.edu>
Apply font-lock-doc-face to doc comments (for issue #5)
---
zig-mode.el | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/zig-mode.el b/zig-mode.el
index eeb012c..221a3a4 100644
--- a/zig-mode.el
+++ b/zig-mode.el
@@ -1,6 +1,6 @@
;;; zig-mode.el --- A major mode for the Zig programming language -*-
lexical-binding: t -*-
-;; Version: 0.0.5
+;; Version: 0.0.6
;; Author: Andrea Orru <andreaorru1991@gmail.com>, Andrew Kelley
<superjoe30@gmail.com>
;; Keywords: zig, languages
;; Package-Requires: ((emacs "24"))
@@ -163,6 +163,14 @@
(zig-syntax-propertize-newline-if-in-multiline-str end)))))
(point) end))
+(defun zig-mode-syntactic-face-function (state)
+ (if (nth 3 state) 'font-lock-string-face
+ (save-excursion
+ (goto-char (nth 8 state))
+ (if (looking-at "///[^/]")
+ 'font-lock-doc-face
+ 'font-lock-comment-face))))
+
;;;###autoload
(define-derived-mode zig-mode c-mode "Zig"
"A major mode for the zig programming language."
@@ -171,7 +179,10 @@
(setq-local comment-start "// ")
(setq-local comment-end "")
(setq-local syntax-propertize-function 'zig-syntax-propertize)
- (setq font-lock-defaults '(zig-font-lock-keywords)))
+ (setq font-lock-defaults '(zig-font-lock-keywords
+ nil nil nil nil
+ (font-lock-syntactic-face-function
+ . zig-mode-syntactic-face-function))))
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.zig\\'" . zig-mode))
- [nongnu] elpa/zig-mode 6309295 069/104: Hide the *zig-fmt* window when formatting succeeds again, (continued)
- [nongnu] elpa/zig-mode 6309295 069/104: Hide the *zig-fmt* window when formatting succeeds again, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 1e75c04 100/104: Remove irrelevant comment, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 0babe7e 103/104: Merge pull request #59 from eric-p-hutchins/params-with-optionals-pointers-and-arrays-oh-my, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 2d0eb23 097/104: Merge pull request #55 from arqv/optim-mode, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 232bfff 010/104: Merge pull request #2 from syohex/fix-package, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode fead48b 002/104: Initial revision., ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode c961a6d 005/104: noreturn., ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 5b3b772 011/104: Removed hook., ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode fb8d52f 017/104: License., ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 4f281e4 020/104: Changed repository location, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode c5315ff 026/104: Apply font-lock-doc-face to doc comments (for issue #5),
ELPA Syncer <=
- [nongnu] elpa/zig-mode c2deea8 037/104: Merge pull request #14 from mgxm/imenu, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 52e3e20 004/104: README., ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode bc1bed3 009/104: Fix package, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 1d26390 015/104: Merge pull request #3 from purcell/patch-1, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 0ed57d8 014/104: Minor fixes, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode e659a58 024/104: Set comment-start and comment-end (for issue #5) (#7), ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode b773127 027/104: Initial implementation of indent-line-function, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 9c200f4 032/104: Add -y flag to apt-get command in AppVeyor install script, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode e0bccb1 047/104: add zig-format-buffer command, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 2acd88f 049/104: add zig-mode-map with default keybinding, ELPA Syncer, 2021/08/29