Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
09-14-2005, 05:52 PM
|
#1
|
Member
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944
Rep:
|
emacs width line
Is there a way to have emacs draw a line vertically down the screen indicating the largest width possible for text so that each line on emacs will print out (using lpr defaults on standard paper with 1" margins) as one line without wrapping?
|
|
|
09-14-2005, 06:43 PM
|
#2
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
I don't know of any emacs modes (or scripts) that would
have that kind of feature. But why don't you just set
auto-fill mode on with a width you know will work?
E.g.:
M-x auto-fill-mode
C-u 60 C-x f
to automatically wrap lines on column 60.
Cheers,
Tink
|
|
|
09-14-2005, 08:13 PM
|
#3
|
Member
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944
Original Poster
Rep:
|
Sounds good, how do I then add that to my .emacs file? Also, do you have any idea what column length is close to what would fill up a printed page (or whatever is standard on tools on *nix systems)?
|
|
|
09-14-2005, 08:27 PM
|
#4
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
Quote:
Originally posted by jrdioko
Sounds good, how do I then add that to my .emacs file? Also, do you have any idea what column length is close to what would fill up a printed page (or whatever is standard on tools on *nix systems)?
|
Sorry, no idea what the standard number of characters - 2" would
be ...
With the first question I can help, though :)
Code:
(setq-default fill-column 66)
(add-hook 'text-mode-hook 'turn-on-auto-fill)
I've set mine to 66 because that's what professional
type-setters have said to be pleasant on the eye to
read, and I agree ;)
Cheers,
Tink
Last edited by Tinkster; 09-14-2005 at 08:36 PM.
|
|
|
09-14-2005, 08:36 PM
|
#5
|
Member
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944
Original Poster
Rep:
|
66 it is, thanks 
|
|
|
09-30-2005, 11:09 PM
|
#6
|
Member
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944
Original Poster
Rep:
|
Actually, I added those lines to my .emacs and it doesn't seem to have changed anything. Is that supposed to auto-wrap on the screen when you get past 66 characters (which isn't happening) or affect only printing or something?
|
|
|
10-01-2005, 11:11 PM
|
#7
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
It works with the emacs major text-mode.
So, if the buffer you're editing isn't in that mode,
nothing will happen.
To activate it if it's NOT turned on:
M-x text-mode
If you need in different text-modes add appropriate hooks.
Cheers,
Tink
|
|
|
10-01-2005, 11:16 PM
|
#8
|
Member
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944
Original Poster
Rep:
|
When I do M-x text-mode, the bottom changes from (Scheme) to (Text Fill), but I can still type more than 66 characters without it wrapping.
|
|
|
10-02-2005, 12:51 AM
|
#9
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
It's not something silly like the missing apostrophe at
the beginning of the '( ... )? I didn't paste those.
Cheers,
Tink
|
|
|
10-02-2005, 01:00 AM
|
#10
|
Member
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944
Original Poster
Rep:
|
Hmm, I have:
Code:
(setq-default fill-column 66)
(add-hook 'text-mode-hook 'turn-on-auto-fill)
|
|
|
10-02-2005, 12:26 PM
|
#11
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
Odd. "Works for me""(tm).
Emacs 21.3.1 that came with Slack 10.1?
And does the manual method work for you?
What does the rest of your .emacs look like?
Cheers,
Tink
|
|
|
10-02-2005, 04:02 PM
|
#12
|
Member
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944
Original Poster
Rep:
|
Emacs 21.3.2 that came with Slack 10.0.
The manual method doesn't work either (let me just make sure I understand this right, that I'm supposed to open a new buffer, type those commands, then type more than 66 characters and it should wrap there instead of going to the end of the line?).
When I do it the manual way, it says something like "fill width set to 60 (was 66)" which seems to imply that the .emacs change did go through. I then do M-x text-mode which changes the bottom to "Text Fill," and then I can type to the end of the screen before it wraps (much more than 60 characters). The rest of my file is:
Code:
(set-background-color "#303030")
(set-foreground-color "#DCDCDC")
(global-font-lock-mode 1)
(line-number-mode 1)
(show-paren-mode 1)
(setq show-paren-delay 0
show-paren-style 'parenthesis)
and some Scheme config I mentioned in another post ( http://www.linuxquestions.org/questi...hreadid=368623).
|
|
|
10-02-2005, 04:18 PM
|
#13
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
Is the whole thing too big to be posted here?
Cheers,
Tink
|
|
|
10-02-2005, 05:16 PM
|
#14
|
Member
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944
Original Poster
Rep:
|
No, I just don't feel comfortable posting config files for all to see for some reason, even if they don't have any personal information. I checked through it again, though, and all that is there are the lines I gave above, a few macros (fset 'name ...), and:
Code:
(setq-default fill-column 66)
(add-hook 'text-mode-hook 'turn-on-auto-fill)
|
|
|
07-10-2009, 11:48 AM
|
#15
|
LQ Newbie
Registered: Jun 2009
Posts: 2
Rep:
|
Quote:
Originally posted by jrdioko
Actually, I added those lines to my .emacs and it doesn't seem to have changed anything. Is that supposed to auto-wrap on the screen when you get past 66 characters (which isn't happening) or affect only printing or something?
|
I had a similar problem and I thought my Emacs was broke. Pressing Space/Enter on a line is supposed to split (i.e. fill) the line if it is longer than the fill width.
Eventually I realised that the auto-fill is not triggered if you press Space/Enter in a column which is before the fill-width value. I was entering text from the beginning of the line, pushing it past the fill width!
|
|
|
All times are GMT -5. The time now is 05:29 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|