Comments (3)
Hi,
For #1 you can use the newline-and-indent function, which removes any trailing whitespace from the line where you press RET (see README.md on how to do this)
If you insist on not using newline-and-indent, then you can have something like this:
(add-hook 'scala-mode-hook '(lambda ()
(local-set-key (kbd "RET") '(lambda ()
(interactive)
(delete-horizontal-space t)
(newline) ;; or what ever you like)))
#2 is something that bothers me also. If you would like to make a pull request with a solution, I'd gladly review it.
You could start by looking how the scala-indent:indent-on-scaladoc-asterisk
is registered in scala-mode2-map.el
and how it is implemented in scala-mode2-indent.el
. Then you can create a new function called scala-indent:fix-scaladoc-close
that does something like the following:
- check that you are inside a multiline comment (like the
indent-on-scaladoc-asterisk
does) - using
looking-back
check for the regexp"^\\s *\\*\\s /"
, ie. space, one asterisk, one space and/
- if so, delete the space before the slash
from emacs-scala-mode.
Thanks for the hint for (1), I followed the readme and I'm happy about my more powerful RET so far.
I started to look into the implementation of (2), but I'm concerned about what happens if a line in a comment starts with /
. For example:
/** some text
* {{{
* // a comment in a code snippet in a comment in a code snippet in a comment on github :)
* }}}
*/
In this case, we would not want to delete the space in the third line, but only in the fifth line.
from emacs-scala-mode.
Thank you for the commit. I have merged it and included you in the list of commiters in README.md.
from emacs-scala-mode.
Related Issues (20)
- move to gitlab HOT 1
- import symbol at point using CTAGS HOT 4
- face colourings incorrect for scalaz right disjunction
- git CI back online
- How do I run scala code blocks in org-mode? HOT 11
- Incompatible with aggressive-indent-mode HOT 12
- Fontification of prettified symbols HOT 1
- Remove ob-scala.el since it depends on abandoned ensime HOT 5
- Multi-line Comments not considered as Blocks HOT 7
- Tag a new release HOT 2
- Support Scala 3/Dotty HOT 48
- Don't understand rationale behind syntax hightlighting. HOT 2
- Inappropriate Indentation for classes with keyword names HOT 2
- Learning Emacs link in the README file is broken HOT 1
- imenu fails with error HOT 3
- Allow to customize parameter list indentation level? HOT 1
- Highlighting stopped working entirely in new Emacs versions HOT 3
- Please consider tag a new release.
- Inserting a space char causes error HOT 1
- Navigate function or class definition WRT start and end HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emacs-scala-mode.