Emacs comments

G

Guillaume Marcais

Given the following piece of code:

# Nice comment
a = 1

'M-x comment-region' in emacs gives me:

# # Nice comment
# a = 1

That's OK. But then, M-x uncomment-region gives me:

Nice comment
a = 1

The comment is gone! I am using the mode-ruby.el from ruby-1.8.1
distribution. Has anybody out there fixed that so it woul preserve the
comments?

Guillaume.
 
Y

Yukihiro Matsumoto

Hi,

In message "Emacs comments"

|That's OK. But then, M-x uncomment-region gives me:
|
|Nice comment
|a = 1
|
|The comment is gone! I am using the mode-ruby.el from ruby-1.8.1
|distribution. Has anybody out there fixed that so it woul preserve the
|comments?

Can you try the attached patch?

matz.

--- ruby-mode.el 27 Jan 2004 06:05:04 -0000 1.76
+++ ruby-mode.el 29 Jan 2004 23:16:42 -0000
@@ -224,3 +224,3 @@ Also ignores spaces after parenthesis wh
(make-variable-buffer-local 'comment-start-skip)
- (setq comment-start-skip "\\(^\\|\\s-\\);?#+ *")
+ (setq comment-start-skip "#+ *")
(setq indent-tabs-mode ruby-indent-tabs-mode)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top