LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 09-14-2005, 05:52 PM   #1
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
Question 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?
 
Old 09-14-2005, 06:43 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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
 
Old 09-14-2005, 08:13 PM   #3
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30
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)?
 
Old 09-14-2005, 08:27 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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.
 
Old 09-14-2005, 08:36 PM   #5
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30
66 it is, thanks
 
Old 09-30-2005, 11:09 PM   #6
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30
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?
 
Old 10-01-2005, 11:11 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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
 
Old 10-01-2005, 11:16 PM   #8
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30
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.
 
Old 10-02-2005, 12:51 AM   #9
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
It's not something silly like the missing apostrophe at
the beginning of the '( ... )? I didn't paste those.


Cheers,
Tink
 
Old 10-02-2005, 01:00 AM   #10
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30
Hmm, I have:

Code:
(setq-default fill-column 66)
(add-hook 'text-mode-hook 'turn-on-auto-fill)
 
Old 10-02-2005, 12:26 PM   #11
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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
 
Old 10-02-2005, 04:02 PM   #12
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30
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).
 
Old 10-02-2005, 04:18 PM   #13
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Is the whole thing too big to be posted here?


Cheers,
Tink
 
Old 10-02-2005, 05:16 PM   #14
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30
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)
 
Old 07-10-2009, 11:48 AM   #15
crstewart
LQ Newbie
 
Registered: Jun 2009
Posts: 2

Rep: Reputation: 0
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
edb (emacs database) won't open file - emacs 20 & 21 tip184 Linux - Software 0 04-03-2004 07:31 AM
Make the start-line in Fluxbox 100% width objorkum Linux - Software 6 03-18-2004 09:22 PM
Line number in Emacs as default saurya_s Linux - Software 1 01-28-2004 06:37 AM
no ctrl-a or ctrl-z in emacs or on command line? ashlock Fedora 5 12-30-2003 08:00 PM
EMACS won't work on unix from command line! jcrapps Programming 2 02-03-2003 10:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration