sanctus Posted April 15, 2008 Report Posted April 15, 2008 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! Quote
johnfp Posted April 15, 2008 Report Posted April 15, 2008 Can you meaningfully comment on the following line to give you more characters to you comment? Quote
sanctus Posted April 15, 2008 Author Report Posted April 15, 2008 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... Quote
alexander Posted April 15, 2008 Report Posted April 15, 2008 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 Quote
sanctus Posted April 15, 2008 Author Report Posted April 15, 2008 I read today something about word-wrap, but I do not remember where if you think you find it in 5 min you would do me a huge favor! Quote
alexander Posted April 15, 2008 Report Posted April 15, 2008 you can disable it with "M-x toggle-truncate-lines" if i'm not mistaken Quote
sanctus Posted April 16, 2008 Author Report Posted April 16, 2008 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 Quote
alexander Posted April 16, 2008 Report Posted April 16, 2008 you can do all of that in the .emacs file (quite a powerful little bugger... rather big bugger) this may prove to be helpful:some basics of what you would edit and how you would add the tagsEmacsWiki: CPerl Mode tutorial on writing your own emacs mode (will probably come in very handy)An Emacs language mode creation tutorial Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.