Jump to content
Science Forums

Recommended Posts

Posted

I'm using emacs to edit matlab files. When I write a comment or code which ends in a column higher than 70 when I hit enter it automatically splits the line into two lines?

Anyone knows how to increase/customize the line length so that it doesn't always split?

Below an example why this is important:

 

mylongexpression = just_a_long_expression; % here I would like to add a comment that looks like this

 

But when I hit Enter after the above line I would get something like:

mylongexpression = just_a_long_expression; % here
                                          % I would 
                                          % like to
                                          % add a
                                          % comment
                                          % that [doesn't]
                                          % looks
                                          % like
                                          % this

I guess you all can see how annoying this can be!

Posted

Yes I could just put the comment on the next line but it would be less clear then to me where the comment belongs...maybe it has to do with the auto-fill option I still have to figure out what it means exactly...

Posted

that would be because emace does auto tabulation and the fact that the page width in emacs is 80 some odd characters (so its easier to read) so it will auto tab it all to where the comment started, but will not let it go over the 88 char mark or something :)

 

you can change page width (you can research it or i can, but its in options)

 

it may be under word wrap options somewhere... i'd have to look

Posted

Doesn't work so far, actually I do not see any difference if toggled on or off...

But eventually I found it: in customize emacs->editing->fill->Fill column where you can set it to 170 for example...

 

And here the next question which goes really into Lisp:

I'm using emacs in matlab-mode to edit (surprise :eek: ) matlab files. The comments begin with "%" and I defined them to be green. Now I would like to add another type of comment (for example beginning with "&" or "%&" and defined to be red) in order to make a difference between important (red) and less imprtant (green) comments.

Anyone knows what I have to do?

 

Thanks very much

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...