Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Emacs questions
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
henning_bravo
Apprentice
Apprentice


Joined: 11 Apr 2007
Posts: 197

PostPosted: Sun Jan 20, 2008 8:59 pm    Post subject: Emacs questions Reply with quote

Hello!

Could someone please help a Emacs newbie with a few things?

* Is it possible to maximize Emacs? I have managed to find out how to make Emacs cover the whole screen. But it's still not maximized.
* I'm trying to use this script for wrapping a word. I added the wrap-region.el file in ~/.emacs. But now what? I don't know any Lisp so I cant figure out how to use the script. How do I wrap a word?

Thanks!
Back to top
View user's profile Send private message
jcornez
Apprentice
Apprentice


Joined: 12 Jan 2006
Posts: 201
Location: Spain

PostPosted: Mon Jan 21, 2008 6:35 am    Post subject: Reply with quote

To do word wrap, you don't need any custom mode. Just set auto-fill-mode.

M-x auto-fill-mode

To fix a paragraph that isn't aligned properly, just use M-q.

Not sure exactly what you mean by maximized - I suppose you don't want any borders from the window manager. I work with emacs at 163 characters wide so that when I do split screen via C-x 3, I end up with two 80 col wide windows side-by-side. How much of the physical screen this uses depends on my font size. I understand this isn't quite what you asked...
Back to top
View user's profile Send private message
V-Li
Retired Dev
Retired Dev


Joined: 03 Jan 2006
Posts: 613

PostPosted: Mon Jan 21, 2008 9:01 am    Post subject: Re: Emacs questions Reply with quote

henning_bravo wrote:
Hello!

Could someone please help a Emacs newbie with a few things?

* Is it possible to maximize Emacs? I have managed to find out how to make Emacs cover the whole screen. But it's still not maximized.


Maybe this depends with which toolkit you build Emacs. Which version? GTK+? Normally your Window manager should provide that maximizing facility...at least if I understand you correctly. Maybe add a screenshot to illustrate your problem?
Back to top
View user's profile Send private message
henning_bravo
Apprentice
Apprentice


Joined: 11 Apr 2007
Posts: 197

PostPosted: Mon Jan 21, 2008 11:22 am    Post subject: Re: Emacs questions Reply with quote

jcornez wrote:
To do word wrap, you don't need any custom mode. Just set auto-fill-mode.

M-x auto-fill-mode

To fix a paragraph that isn't aligned properly, just use M-q.

I don't think you and I are talking about the same thing? I'm looking for a feature that can wrap a word with for example any of these characters: <,>,[,],",(,) etc...
I want to use this when programming. So if I have for example this:
Code:
String str1 = This is a string
String str1 = This_is_a_string

I want to be able to get this:
Code:
String str1 = "This is a string"
String str1 = "This_is_a_string"

In the first case I want to select the region to wrap. And in the next case (when there's only one word) I want to be able to only put the cursor on it. And then press the magic keys.

About the maximize problem. Take a look at this screenshot. As you might see (a little har to see though) Emacs isn't fully maximized. There are a few pixels around. And as you see at the maximize button on the Emacs frame it's not "two windows", but one.
Back to top
View user's profile Send private message
V-Li
Retired Dev
Retired Dev


Joined: 03 Jan 2006
Posts: 613

PostPosted: Mon Jan 21, 2008 1:02 pm    Post subject: Re: Emacs questions Reply with quote

henning_bravo wrote:

About the maximize problem. Take a look at this screenshot. As you might see (a little har to see though) Emacs isn't fully maximized. There are a few pixels around. And as you see at the maximize button on the Emacs frame it's not "two windows", but one.


There have been some issues regarding been fixed in the development versions. Try one of the CVS versions (app-editors/emacs-cvs), you can install them side-by-side with the stable ones and run it by emacs-22-cvs or you select one by the eselect emacs module.


Last edited by V-Li on Mon Jan 21, 2008 1:11 pm; edited 2 times in total
Back to top
View user's profile Send private message
jcornez
Apprentice
Apprentice


Joined: 12 Jan 2006
Posts: 201
Location: Spain

PostPosted: Mon Jan 21, 2008 1:08 pm    Post subject: Reply with quote

Well, you are definitely not talking about anything that I've ever heard about referred to as word wrapping. Word wrapping (that I know) is typically breaking sentences at the end of a line so that the words are not broken in the middle. And this is known as filling in emacs (hence auto-fill-mode).

I can't figure out exactly what you want. Do you just want to put quotes around some string? or are you after something more general? You can likely define a keyboard macro to add quotes around some string.
Back to top
View user's profile Send private message
henning_bravo
Apprentice
Apprentice


Joined: 11 Apr 2007
Posts: 197

PostPosted: Mon Jan 21, 2008 4:56 pm    Post subject: Re: Emacs questions Reply with quote

V-Li wrote:
There have been some issues regarding been fixed in the development versions. Try one of the CVS versions (app-editors/emacs-cvs), you can install them side-by-side with the stable ones and run it by emacs-22-cvs or you select one by the eselect emacs module.

Ok, thanks!

jcornez wrote:
Well, you are definitely not talking about anything that I've ever heard about referred to as word wrapping. Word wrapping (that I know) is typically breaking sentences at the end of a line so that the words are not broken in the middle. And this is known as filling in emacs (hence auto-fill-mode).

I can't figure out exactly what you want. Do you just want to put quotes around some string? or are you after something more general? You can likely define a keyboard macro to add quotes around some string.

Well... pretty much. Except that I want to be able to wrap with other than quoutes. I thought at first that I should do some macros but then I found the script (http://sami.samhuri.net/2007/6/23/emacs-for-textmate-junkies) that I think shall do what I want. Though I'm not sure of how to use it.
Back to top
View user's profile Send private message
jcornez
Apprentice
Apprentice


Joined: 12 Jan 2006
Posts: 201
Location: Spain

PostPosted: Mon Jan 21, 2008 5:18 pm    Post subject: Reply with quote

Well, I've never used that script, so I can't be sure - you should ask the author. But in general, you add that code to your .emacs file, or to some file that your .emacs loads. And that should be about it. The bottom of the script adds global key bindings (global-set-key ...), so it should be that using those keys will invoke the functions defined above in the script.

Maybe you could say what you are trying and what is failing.
Back to top
View user's profile Send private message
henning_bravo
Apprentice
Apprentice


Joined: 11 Apr 2007
Posts: 197

PostPosted: Tue Jan 22, 2008 5:44 am    Post subject: Reply with quote

jcornez wrote:
Well, I've never used that script, so I can't be sure - you should ask the author. But in general, you add that code to your .emacs file, or to some file that your .emacs loads. And that should be about it. The bottom of the script adds global key bindings (global-set-key ...), so it should be that using those keys will invoke the functions defined above in the script.

Maybe you could say what you are trying and what is failing.

Yes, since there are global-set-key bindings I should be able to put the cursor on a string and then press (for example) shift + 2 to wrap it with ". But that doesn't happend. If I would hade done that in the middle of a word it would have been behaving like this: the""word
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum