[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/scala-mode 8d4f34f 058/217: Use font-lock-doc-face for sca
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/scala-mode 8d4f34f 058/217: Use font-lock-doc-face for scaladoc comments |
Date: |
Sun, 29 Aug 2021 11:30:43 -0400 (EDT) |
branch: elpa/scala-mode
commit 8d4f34fe58b1c2699f01eb5b5104ed0a47adfc0f
Author: Heikki Vesalainen <heikkivesalainen@yahoo.com>
Commit: Heikki Vesalainen <heikkivesalainen@yahoo.com>
Use font-lock-doc-face for scaladoc comments
---
README.md | 4 +++-
scala-mode-fontlock.el | 9 +++++++++
scala-mode-paragraph.el | 2 +-
scala-mode.el | 4 +++-
4 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 92f7193..6593f82 100644
--- a/README.md
+++ b/README.md
@@ -321,6 +321,8 @@ customization variable *frame-background-mode* to *dark*
(use **M-x**
## Future work
+- syntax-begin-function for reliably fontifying elements which span
+ multiple lines
- beginning-of-defun, end-of-defun
- indent case, etc after they are typed (use first space as self-insert-hook)
- indent multi-line strings with margin correctly
@@ -341,4 +343,4 @@ Contributors and valuable feedback:
- Ray Racine
- Eiríkr Åsheim (aka Erik Osheim)
- Seth Tisue
-- Gary Pamparà
\ No newline at end of file
+- Gary Pamparà
diff --git a/scala-mode-fontlock.el b/scala-mode-fontlock.el
index bd78a97..588692d 100644
--- a/scala-mode-fontlock.el
+++ b/scala-mode-fontlock.el
@@ -467,3 +467,12 @@ Does not continue past limit.
(scala-font-lock:mark-integerLiteral . font-lock-constant-face)
))
+
+(defun scala-font-lock:syntactic-face-function (state)
+ "Return correct face for string or comment"
+ (if (and (integerp (nth 4 state))
+ (save-excursion
+ (goto-char (nth 8 state))
+ (looking-at "/\\*\\*\\($\\|[^*]\\)")))
+ font-lock-doc-face
+ (if (nth 3 state) font-lock-string-face font-lock-comment-face)))
diff --git a/scala-mode-paragraph.el b/scala-mode-paragraph.el
index c5679bf..ef14e60 100644
--- a/scala-mode-paragraph.el
+++ b/scala-mode-paragraph.el
@@ -103,7 +103,7 @@
(fill-paragraph))
t)
((eq (nth 4 state) t)
- ;; let normal fill-function handle this
+ ;; line comment, let normal fill-function handle this
nil)
((eq (nth 3 state) t)
;; mask multi-line strings and fill.
diff --git a/scala-mode.el b/scala-mode.el
index 716ae05..6ba9915 100644
--- a/scala-mode.el
+++ b/scala-mode.el
@@ -51,6 +51,7 @@ When started, runs `scala-mode-hook'.
'scala-mode:debug-messages
'post-self-insert-hook
'syntax-propertize-function
+ 'font-lock-syntactic-face-function
'font-lock-defaults
'paragraph-start
'paragraph-separate
@@ -74,8 +75,9 @@ When started, runs `scala-mode-hook'.
parse-sexp-lookup-properties t
;; TODO: font-lock
- font-lock-defaults '((scala-font-lock:keywords)
+ font-lock-defaults '(scala-font-lock:keywords
nil)
+ font-lock-syntactic-face-function
'scala-font-lock:syntactic-face-function
;; TODO: beginning-of-defun-function, end-of-defun-function
- [nongnu] elpa/scala-mode 5d28cb3 210/217: feat: support trailing commas (>= Scala 2.12.2), (continued)
- [nongnu] elpa/scala-mode 5d28cb3 210/217: feat: support trailing commas (>= Scala 2.12.2), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode b21befd 211/217: Fix README.md indenting, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode d837c96 203/217: doc: supports both Scala 2 and 3 (to some extent), not just 2.9, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 2bf5621 207/217: Update README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 402d6df 209/217: Merge pull request #165 from fommil/sbtn, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode ac8106f 025/217: Update README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode d81bc28 028/217: indenting code lines also removes trailing whitespace, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 26cd0b7 040/217: merged from align-parameters, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 884795f 052/217: more fixes to strings, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 7113976 059/217: Indenting for multi-line strings with margin, fixed row comment indent, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 8d4f34f 058/217: Use font-lock-doc-face for scaladoc comments,
ELPA Syncer <=
- [nongnu] elpa/scala-mode 689bd7d 089/217: (require 'package), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode cb3f278 086/217: Update for marmalade / melpa package., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 1a241eb 076/217: Add `scala-indent:insert-asterisk-on-multiline-comment`., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 5cd1b20 068/217: Properly align constructor val and var params., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode ad73d10 096/217: Merge pull request #49 from zbskii/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode defa2af 098/217: pkg.el cleanup, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 13b30a6 093/217: Added Hugh Giddens to contributors, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 9ab0a59 091/217: Update README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode c48b479 113/217: Update README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode af2dc30 136/217: Removed Marmelade from README.md, ELPA Syncer, 2021/08/29