[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/scala-mode d4cccb0 112/217: scala-mode:set-scala-syntax-mo
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/scala-mode d4cccb0 112/217: scala-mode:set-scala-syntax-mode to support sbt-mode |
Date: |
Sun, 29 Aug 2021 11:30:54 -0400 (EDT) |
branch: elpa/scala-mode
commit d4cccb080530d761585bb95133487494da8c49bd
Author: Heikki Vesalainen <heikkivesalainen@yahoo.com>
Commit: Heikki Vesalainen <heikkivesalainen@yahoo.com>
scala-mode:set-scala-syntax-mode to support sbt-mode
---
scala-mode2-syntax.el | 3 ++-
scala-mode2.el | 16 ++++++++++++++++
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/scala-mode2-syntax.el b/scala-mode2-syntax.el
index ace37dc..93f4979 100644
--- a/scala-mode2-syntax.el
+++ b/scala-mode2-syntax.el
@@ -219,7 +219,6 @@
(scala-syntax:looking-at-stableIdOrPath)))
-
(defun scala-syntax:regexp-for-id (id)
(let ((prefix-regex
(if (string-match scala-syntax:alphaid-re id)
@@ -743,6 +742,7 @@ id, reserved symbol, keyword, block, or literal. Delimiters
(.,;)
and comments are skipped silently. Position is placed at the
beginning of the skipped expression."
(interactive)
+ (syntax-propertize (point-max))
;; emacs knows how to properly skip: lists, varid, capitalid,
;; strings, symbols, chars, quotedid. What we have to handle here is
;; most of all ids made of op chars
@@ -764,6 +764,7 @@ beginning of the skipped expression."
silently. Position is placed at the beginning of the skipped
expression."
(interactive)
+ (syntax-propertize (point))
;; for implementation comments, see scala-syntax:forward-sexp
(forward-comment (- (buffer-size)))
(while (> 0 (+ (skip-syntax-backward " ")
diff --git a/scala-mode2.el b/scala-mode2.el
index 40e29f3..5e5b5b2 100644
--- a/scala-mode2.el
+++ b/scala-mode2.el
@@ -62,6 +62,21 @@ If there is no plausible default, return nil."
(scala-syntax:forward-sexp))))
;;;###autoload
+(defun scala-mode:set-scala-syntax-mode ()
+ "Sets the syntax-table and other realted variables for the current buffer to
those of scala-mode. Can be used to make some other major mode (such as
sbt-mode) use scala syntax-table."
+ (set-syntax-table scala-syntax:syntax-table)
+ (scala-mode:make-local-variables
+ 'syntax-propertize-function
+ 'parse-sexp-lookup-properties
+ 'forward-sexp-function)
+
+ (add-hook 'syntax-propertize-extend-region-functions
+ 'scala-syntax:propertize-extend-region)
+ (setq syntax-propertize-function 'scala-syntax:propertize
+ parse-sexp-lookup-properties t
+ forward-sexp-function 'scala-mode:forward-sexp-function))
+
+;;;###autoload
(define-derived-mode scala-mode prog-mode "Scala"
"Major mode for editing scala code.
@@ -79,6 +94,7 @@ When started, runs `scala-mode-hook'.
'font-lock-defaults
'paragraph-start
'paragraph-separate
+ 'parse-sexp-lookup-properties
'fill-paragraph-function
'adaptive-fill-function
'adaptive-fill-first-line-regexp
- [nongnu] elpa/scala-mode aa38dae 083/217: Fixes #38: 100% CPU usage for multi-line strings in some cases., (continued)
- [nongnu] elpa/scala-mode aa38dae 083/217: Fixes #38: 100% CPU usage for multi-line strings in some cases., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 0af3b07 069/217: Added Makefile and fixed compilation warnings, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode be89855 084/217: Multi-line comment indentation and asterisk-insertion on mid-line return., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 711091a 087/217: moved provides to end of files, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 6312b36 082/217: Make the code agreeable to Emacs-Lisp mode, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 18a52f0 094/217: Update installation instructions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode a1ea0b7 097/217: Proper instructions and autoload settings for package-based install, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 763c93c 107/217: scala-indent:join-line, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode c62ecf9 109/217: Update README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode aea047a 104/217: Create .gitignore with *.elc, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode d4cccb0 112/217: scala-mode:set-scala-syntax-mode to support sbt-mode,
ELPA Syncer <=
- [nongnu] elpa/scala-mode c9dd697 103/217: alphaid-re for SIP11 support, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 89c7138 102/217: Merge pull request #52 from non/topic/octal-escapes, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 600d27b 115/217: join-line cannot be re-defined like this, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 890b7eb 129/217: Document */ behavior in multi-line comments., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 3d330ad 126/217: Makefile clean-up 2, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 6c4e8dc 128/217: Delete automatic space between * and /., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 84ff656 138/217: Update README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode c90e085 131/217: Tweaked syntax rules to make highlighting more customizeable, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 68959cd 144/217: imenu is mostly working., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 1954eaa 146/217: move all stuff related to moving between defintions to bottom of scala-mode-syntax.el, ELPA Syncer, 2021/08/29