4
4
5
5
; ; Author: Lefteris Karapetsas <[email protected] >
6
6
; ; Keywords: languages
7
- ; ; Version: 0.1.6
7
+ ; ; Version: 0.1.7
8
8
9
9
; ; This program is free software; you can redistribute it and/or modify
10
10
; ; it under the terms of the GNU General Public License as published by
@@ -97,6 +97,25 @@ Possible values are:
97
97
:package-version '(solidity . " 0.1.5" )
98
98
:safe #'symbolp )
99
99
100
+ (defcustom solidity-comment-style 'star
101
+ " Denotes the style of comments to use for solidity when commenting.
102
+
103
+ This option will define what kind of comments will be input into the buffer by
104
+ commands like `comment-region' . The default value is 'star.
105
+ Possible values are:
106
+
107
+ `star'
108
+ Follow the same styling as C mode does by default having all comments
109
+ obey the /* .. */ style.
110
+
111
+ `slash'
112
+ All comments will start with //."
113
+ :group 'solidity
114
+ :type '(choice (const :tag " Commenting starts with /* and ends with */" star)
115
+ (const :tag " Commenting starts with //" slash))
116
+ :package-version '(solidity . " 0.1.7" )
117
+ :safe #'symbolp )
118
+
100
119
(defvar solidity-mode-map
101
120
(let ((map (make-sparse-keymap )))
102
121
(define-key map " \C -j" 'newline-and-indent )
@@ -529,9 +548,13 @@ Cursor must be at the function's name. Does not currently work for constructors
529
548
(set-syntax-table solidity-mode-syntax-table)
530
549
; ; specify syntax highlighting
531
550
(setq font-lock-defaults '(solidity-font-lock-keywords))
532
- ; ; register indentation functions, basically the c-mode ones
533
- (make-local-variable 'comment-start )
534
- (make-local-variable 'comment-end )
551
+
552
+ ; ; register indentation and other langue mode functions, basically the c-mode ones with some modifications
553
+ (let ((start-value (if (eq solidity-comment-style 'star ) " /* " " // " ))
554
+ (end-value (if (eq solidity-comment-style 'star ) " */" " " )))
555
+ (set (make-local-variable 'comment-start ) start-value)
556
+ (set (make-local-variable 'comment-end ) end-value))
557
+
535
558
(make-local-variable 'comment-start-skip )
536
559
537
560
(make-local-variable 'paragraph-start )
@@ -541,7 +564,7 @@ Cursor must be at the function's name. Does not currently work for constructors
541
564
(make-local-variable 'adaptive-fill-regexp )
542
565
(make-local-variable 'fill-paragraph-handle-comment )
543
566
544
- ; ; now set their values
567
+ ; ; set values for some other variables
545
568
(set (make-local-variable 'parse-sexp-ignore-comments ) t )
546
569
(set (make-local-variable 'indent-line-function ) 'c-indent-line )
547
570
(set (make-local-variable 'indent-region-function ) 'c-indent-region )
0 commit comments