Science Forums
User Name
Password
Science Social Network
home    members    help/rules    who is online    contact   

Go Back   Science Forums > Physical Sciences Forums > Computer Science
Become a science forums sponsor today
Reply
 
LinkBack Thread Tools
Old 04-15-2008   #1 (permalink)
sanctus's Avatar
Resident Diabolist

Hypography Staff Member
Administrator

 



emacs matlab mode

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:

Code:
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:
Code:
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!


----------------
Administrator

A COUNTRY WITHOUT AN ARMY IS LIKE A FISH WITHOUT A BIKE!!!


I don't believe in god, but I do believe in what others call utopies.
Reply With Quote
Old 04-15-2008   #2 (permalink)
johnfp's Avatar
Thinking


 



Re: emacs matlab mode

Can you meaningfully comment on the following line to give you more characters to you comment?


----------------
Home Page: http://www.holograms3d.com
Reply With Quote
Old 04-15-2008   #3 (permalink)
sanctus's Avatar
Resident Diabolist

Hypography Staff Member
Administrator

 



Re: emacs matlab mode

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


----------------
Administrator

A COUNTRY WITHOUT AN ARMY IS LIKE A FISH WITHOUT A BIKE!!!


I don't believe in god, but I do believe in what others call utopies.
Reply With Quote
Old 04-15-2008   #4 (permalink)
alexander's Avatar
Resident USSRian

Hypography Staff Member
Administrator
Gallery Curator
Dev Team Member

Latest blog entry:
Open-Source HIDS
 
alexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant future
Send a message via AIM to alexander
 



Re: emacs matlab mode

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


----------------
And remember that great question that Pierre-Simon Laplace and Sir Isaac Newton, Andrei Markov and David Hilbert, Richard Feynman and Enrico Fermi, Albert Einstein and Edmund Halley did not come to ask throughout all of their dedication and work: "Who the hell is IMing me?"


This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.
Reply With Quote
Old 04-15-2008   #5 (permalink)
sanctus's Avatar
Resident Diabolist

Hypography Staff Member
Administrator

 



Re: emacs matlab mode

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!


----------------
Administrator

A COUNTRY WITHOUT AN ARMY IS LIKE A FISH WITHOUT A BIKE!!!


I don't believe in god, but I do believe in what others call utopies.
Reply With Quote
Old 04-15-2008   #6 (permalink)
alexander's Avatar
Resident USSRian

Hypography Staff Member
Administrator
Gallery Curator
Dev Team Member

Latest blog entry:
Open-Source HIDS
 
alexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant future
Send a message via AIM to alexander
 



Re: emacs matlab mode

you can disable it with "M-x toggle-truncate-lines" if i'm not mistaken


----------------
And remember that great question that Pierre-Simon Laplace and Sir Isaac Newton, Andrei Markov and David Hilbert, Richard Feynman and Enrico Fermi, Albert Einstein and Edmund Halley did not come to ask throughout all of their dedication and work: "Who the hell is IMing me?"


This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.
Reply With Quote
Old 04-16-2008   #7 (permalink)
sanctus's Avatar
Resident Diabolist

Hypography Staff Member
Administrator

 



Re: emacs matlab mode

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


----------------
Administrator

A COUNTRY WITHOUT AN ARMY IS LIKE A FISH WITHOUT A BIKE!!!


I don't believe in god, but I do believe in what others call utopies.
Reply With Quote
Old 04-16-2008   #8 (permalink)
alexander's Avatar
Resident USSRian

Hypography Staff Member
Administrator
Gallery Curator
Dev Team Member

Latest blog entry:
Open-Source HIDS
 
alexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant future
Send a message via AIM to alexander
 



Re: emacs matlab mode

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 tags
EmacsWiki: CPerl Mode

tutorial on writing your own emacs mode (will probably come in very handy)
An Emacs language mode creation tutorial


----------------
And remember that great question that Pierre-Simon Laplace and Sir Isaac Newton, Andrei Markov and David Hilbert, Richard Feynman and Enrico Fermi, Albert Einstein and Edmund Halley did not come to ask throughout all of their dedication and work: "Who the hell is IMing me?"


This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using c code in Matlab...on xubuntu sanctus Computer Science 5 02-22-2008 05:51 AM
Standard map in matlab sanctus Computer Science 5 05-03-2005 06:03 PM


All times are GMT -8. The time now is 04:55 PM.

Hypography?

Hypography [n.]: A combination of "hyperlink" and "bibliography" - ie, a list of links to electronic documents. Comparable to discography and bibliography, but not cartography.

We have been online since May 2000, and aim to be the best place to find and share science-related content of all kinds.

Share the love!

Please add more science to your life. Use our RSS feeds on your blog, your portal, or your favorite feedreader!

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc. Copyright © 2000-2008 Hypography
Part of the Hypography - Science for Everyone Network