[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/scala-mode 1a241eb 076/217: Add `scala-indent:insert-aster
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/scala-mode 1a241eb 076/217: Add `scala-indent:insert-asterisk-on-multiline-comment`. |
Date: |
Sun, 29 Aug 2021 11:30:47 -0400 (EDT) |
branch: elpa/scala-mode
commit 1a241eb58769f33d46edae0c5c6145f8b1c7f108
Author: Evan Meagher <evm@twitter.com>
Commit: Evan Meagher <evm@twitter.com>
Add `scala-indent:insert-asterisk-on-multiline-comment`.
When enabled, inserts asterisk at end-of-line of multi-line comments.
---
README.md | 9 +++++++++
scala-mode-indent.el | 11 ++++++++++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 39f9fe1..f45dc55 100644
--- a/README.md
+++ b/README.md
@@ -274,6 +274,15 @@ you may want to try. Just copy-paste it to your `.emacs`
file.
;; 'reindent-then-newline-and-indent' command.
(local-set-key (kbd "RET") 'newline-and-indent)
+ ;; Alternatively, bind the 'newline-and-indent' command and
+ ;; 'scala-indent:insert-asterisk-on-multiline-comment' to RET in
+ ;; order to get indentation and asterisk-insertion within multi-line
+ ;; comments.
+ (local-set-key (kbd "RET") '(lambda ()
+ (interactive)
+ (newline-and-indent)
+ (scala-indent:insert-asterisk-on-multiline-comment)))
+
;; Bind the 'join-line' command to C-M-j. This command is normally
;; bound to M-^ which is hard to access, especially on some European
;; keyboards. The 'join-line' command has the effect or joining the
diff --git a/scala-mode-indent.el b/scala-mode-indent.el
index 18f5079..7a89efc 100644
--- a/scala-mode-indent.el
+++ b/scala-mode-indent.el
@@ -856,6 +856,15 @@ the line."
(insert " "))
(scala-indent:indent-line-to (scala-indent:scaladoc-indent (nth 8
state))))))
+(defun scala-indent:insert-asterisk-on-multiline-comment ()
+ "Insert an asterisk at the end of the current line when at the beginning
+of a line inside a multi-line comment "
+ (let ((state (syntax-ppss)))
+ (when (and (integerp (nth 4 state))
+ (integerp (string-match-p "^\\s-*$" (thing-at-point 'line))))
+ (end-of-line)
+ (insert "*")
+ (scala-indent:indent-on-scaladoc-asterisk))))
+
(defun scala-mode:indent-scaladoc-asterisk (&optional insert-space-p)
(message "scala-mode:indent-scaladoc-asterisk has been deprecated"))
-
- [nongnu] elpa/scala-mode 2bf5621 207/217: Update README.md, (continued)
- [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, 2021/08/29
- [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 <=
- [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
- [nongnu] elpa/scala-mode 8d4d99b 156/217: Add optional flattening to creation of imenu index (again)., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode aebed53 168/217: Mark a couple of indentation variables as safe (#105), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode ece95ca 170/217: use CI to compile PRs, ELPA Syncer, 2021/08/29