Professional Web Applications Themes

Emacs comments - Ruby

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....

  1. #1

    Default Emacs comments

    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.



    Guillaume Guest

  2. #2

    Default Re: Emacs comments

    Hi,

    In message "Emacs comments"
    on 04/01/30, Guillaume Marcais <fr> writes:

    |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)


    Yukihiro Guest

  3. #3

    Default Re: Emacs comments

    Works great. Thanks for your quick response.

    Guillaume.

    On Thu, 2004-01-29 at 18:17, Yukihiro Matsumoto wrote: 




    Guillaume Guest

Similar Threads

  1. Problems with comments-enabled PDF: Ican't see my client's comments
    By Amy_Stewart@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 2
    Last Post: March 19th, 07:39 PM
  2. Disable Options>Import Comments in Comments Pane
    By Joeri_Paeleman@adobeforums.com in forum Adobe Acrobat SDK
    Replies: 0
    Last Post: August 8th, 01:02 PM
  3. Emacs syntax highlight of Perl comments
    By Alythh in forum PERL Miscellaneous
    Replies: 9
    Last Post: October 17th, 06:50 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139