all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: soft wrapping and line numbers
       [not found] <b8mjep$8b2$1@acs2.byu.edu>
@ 2003-04-29 23:54 ` Johan Bockgård
  2003-04-30 13:53 ` Javier Oviedo
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Johan Bockgård @ 2003-04-29 23:54 UTC (permalink / raw)


Eric Carlsen <eric_carlsen@[NO-SPAM].hotmail.com> writes:

> The other feature I would like is to have the line number written
> beside each line.

http://www.emacswiki.org/cgi-bin/wiki.pl?LineNumbers

-- 
The day Microsoft makes something that doesn't suck is probably the
day they start making vacuum cleaners. -- Ernst Jan Plugge

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: soft wrapping and line numbers
       [not found] <b8mjep$8b2$1@acs2.byu.edu>
  2003-04-29 23:54 ` soft wrapping and line numbers Johan Bockgård
@ 2003-04-30 13:53 ` Javier Oviedo
  2003-05-01 14:45   ` John Kliff Jochens
       [not found]   ` <mailman.5444.1051801721.21513.help-gnu-emacs@gnu.org>
  2003-04-30 14:41 ` Kai Großjohann
  2003-04-30 18:20 ` Roodwriter
  3 siblings, 2 replies; 11+ messages in thread
From: Javier Oviedo @ 2003-04-30 13:53 UTC (permalink / raw)


I have recently inquired about the line-number issue as well. Most everyone
directed me to setnu.el, but it caused some funny behavior with my
configuration.

I was then told about wb-line-number.el. I like this very much. You can find
it at:

http://www.anc.ed.ac.uk/~stephen/emacs/ell.html

--
=======
Javier
"Eric Carlsen" <eric_carlsen@[NO-SPAM].hotmail.com> wrote in message
news:b8mjep$8b2$1@acs2.byu.edu...
> I recently started using emacs and I was wondering if there is a way to
> do some things. For one, is soft word wrapping implemented yet? By this
> I mean that there are no newlines inserted in text but it wraps lines on
> the screen without breaking up characters. Vim does it with lbr (I'm not
> trying to flame, just give background) and I think it is commonly done
> in the windows world.
>
> The other feature I would like is to have the line number written beside
> each line. Is that possible? Thanks for any help. I've tried to read the
> manuals and look online but I haven't found any solutions yet.
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: soft wrapping and line numbers
       [not found] <b8mjep$8b2$1@acs2.byu.edu>
  2003-04-29 23:54 ` soft wrapping and line numbers Johan Bockgård
  2003-04-30 13:53 ` Javier Oviedo
@ 2003-04-30 14:41 ` Kai Großjohann
  2003-04-30 18:20 ` Roodwriter
  3 siblings, 0 replies; 11+ messages in thread
From: Kai Großjohann @ 2003-04-30 14:41 UTC (permalink / raw)


Eric Carlsen <eric_carlsen@[NO-SPAM].hotmail.com> writes:

> I recently started using emacs and I was wondering if there is a way
> to do some things. For one, is soft word wrapping implemented yet? By
> this I mean that there are no newlines inserted in text but it wraps
> lines on the screen without breaking up characters. Vim does it with
> lbr (I'm not trying to flame, just give background) and I think it is
> commonly done in the windows world.

I have written longlines.el which I'm afraid is a bit of a kludge.
But it might do what you need.

It adds newlines into the buffer when the file is read from disk, and
it removes those newlines again when the file is written back to disk.

-- 
file-error; Data: (Opening input file no such file or directory ~/.signature)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: soft wrapping and line numbers
       [not found] <b8mjep$8b2$1@acs2.byu.edu>
                   ` (2 preceding siblings ...)
  2003-04-30 14:41 ` Kai Großjohann
@ 2003-04-30 18:20 ` Roodwriter
  2003-05-01 22:44   ` Stefan Monnier
  3 siblings, 1 reply; 11+ messages in thread
From: Roodwriter @ 2003-04-30 18:20 UTC (permalink / raw)


Eric Carlsen wrote:

> I recently started using emacs and I was wondering if there is a way to
> do some things. For one, is soft word wrapping implemented yet? By this
> I mean that there are no newlines inserted in text but it wraps lines on
> the screen without breaking up characters. Vim does it with lbr (I'm not
> trying to flame, just give background) and I think it is commonly done
> in the windows world.
> 
> The other feature I would like is to have the line number written beside
> each line. Is that possible? Thanks for any help. I've tried to read the
> manuals and look online but I haven't found any solutions yet.


The lack of a true word wrap with Emacs is my mine gripe with it. (This may 
only apply to writers.) But I've worked out a workaround. One no one else 
in the world will probably use. But here it is.

First, there's the Refill command. This works like the Fill command but it 
will REfill when you type something back in the middle of a filled 
paragraph. In other words, you don't have to M-q. It works pretty well, 
except . . .

It won't let you line up short lines. It'll greedily join them together. If 
you try to do this:

One or
two words
on a line.

You'll end up with:

One or two words on a line.

This is why I bound it to a function key so I could toggle it on and off 
when I make lists.

Refill also has problems with tabs--indenting everything.

But it works pretty well by typing out things with the TeX and friends 
method. That is, no tabs and double-spacing between each paragraph. 
(Ironically, refill conflicts with AucTex itself. You can't use it.)

That's not a bad way to work if you're like me and tend to hit the caps lock 
when you're reaching for the tab key. But if you want your text to have 
proper tabs you can do my Handy-Dandy, Patented, Kludgey, Little Genius 
Workaround.

I made a macro which converts two newlines in a row using replace-regexp to 
a tab and carriage return plus converts ALL single newlines to spaces so 
the individual lines within the paragraph join together. I also did another 
sweep to convert two spaces to one space, in case I ended up with too many 
between words.

I don't know how fast it would work on something the length of a book, but 
for the short news stories I write, it's done in a second.

After this activates you'll have tabs and long lines again. That's how I 
save everything since it facilitates a grep search. But if you call up that 
file on another day you'll have a problem because of the tabs. I made a 
companion macro that takes out the tabs and puts in newlines for this 
reason.

It never fails to irritate me that the most advanced editor on the planet 
can't do a job that Windows Notepad can handle. I'd really like that on my 
wishlist, but I doubt I'd be the first. There may be some reason it won't 
work. The other thing I wish would be incorporated would be the automatic 
capitalization at the beginning of sentences. There's an add-on out there 
that'll do it. I haven't tried it.

This is getting a bit long but I need to say something else about refill. 
The macro I just described won't work if you need paragraphs like you see 
here or a single-line list, like the "one or two words" thing I did above. 
I have to run a different series of finds and replaces to keep the 
double-spacing but make the long lines. It's nice that Emacs makes macros 
so easily.

Dunno if this helps.

--Rod

-- 
Author of "Linux for Non-Geeks--Clear-eyed Answers for Practical Consumers" 
and "Boring Stories from Uncle Rod." Both are available at 
http://www.rodwriterpublishing.com/index.html

To reply by e-mail, take the extra "o" out of my e-mail address. It's to 
confuse spambots, of course.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: soft wrapping and line numbers
  2003-04-30 13:53 ` Javier Oviedo
@ 2003-05-01 14:45   ` John Kliff Jochens
       [not found]   ` <mailman.5444.1051801721.21513.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 11+ messages in thread
From: John Kliff Jochens @ 2003-05-01 14:45 UTC (permalink / raw)


On Wed, 2003-04-30 at 10:53, Javier Oviedo wrote:
> I have recently inquired about the line-number issue as well. Most everyone
> directed me to setnu.el, but it caused some funny behavior with my
> configuration.
> 
> I was then told about wb-line-number.el. I like this very much. You can find
> it at:
> 
> http://www.anc.ed.ac.uk/~stephen/emacs/ell.html
> 

I tried it and it was very nice (way better than setnu). 
Anyway, there are a couple things I would like to get working:

1. I put 
(require 'wb-line-number)
(wb-line-number-toggle)
in my .emacs, therefore, whenever I open emacs or a file with it, the buffer already has line numbering. But if I open another VERTICAL buffer (C-x 3) there is no line numbering for that buffer (this does't happen if I open another HORIZONTAL buffer, C-x 2, as there is line numbering accordingly). ANy help?

2. There is this weird bar alongside with the numbers (reminds me of the annoying scrollbar). Is there a way to get rid of it?

Thanks in advance.

-- 
John Kliff Jochens <jk-listas@bol.com.br>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: soft wrapping and line numbers
  2003-04-30 18:20 ` Roodwriter
@ 2003-05-01 22:44   ` Stefan Monnier
  2003-05-02 19:06     ` Roodwriter
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2003-05-01 22:44 UTC (permalink / raw)


>>>>> "Roodwriter@core" == Roodwriter@core com <Roodwriter@core.com> writes:
> Refill also has problems with tabs--indenting everything.

I'm not sure what you're referring to here.  Could you expand on it
a little ?

> That's not a bad way to work if you're like me and tend to hit the caps lock
> when you're reaching for the tab key. But if you want your text to have
> proper tabs you can do my Handy-Dandy, Patented, Kludgey, Little Genius
> Workaround.

You might want to try longlines.el which does the same as your workaround
but differently and allows you to deal with short unwrapped lines (using
use-hard-newlines).


        Stefan

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: soft wrapping and line numbers
       [not found]   ` <mailman.5444.1051801721.21513.help-gnu-emacs@gnu.org>
@ 2003-05-02 14:25     ` Javier Oviedo
  0 siblings, 0 replies; 11+ messages in thread
From: Javier Oviedo @ 2003-05-02 14:25 UTC (permalink / raw)


I'm not sure how to do this. E-mail the creator of the package. He is very
helpful.

--
=======
Javier
"John Kliff Jochens" <jk-listas@bol.com.br> wrote in message
news:mailman.5444.1051801721.21513.help-gnu-emacs@gnu.org...
> On Wed, 2003-04-30 at 10:53, Javier Oviedo wrote:
> > I have recently inquired about the line-number issue as well. Most
everyone
> > directed me to setnu.el, but it caused some funny behavior with my
> > configuration.
> >
> > I was then told about wb-line-number.el. I like this very much. You can
find
> > it at:
> >
> > http://www.anc.ed.ac.uk/~stephen/emacs/ell.html
> >
>
> I tried it and it was very nice (way better than setnu).
> Anyway, there are a couple things I would like to get working:
>
> 1. I put
> (require 'wb-line-number)
> (wb-line-number-toggle)
> in my .emacs, therefore, whenever I open emacs or a file with it, the
buffer already has line numbering. But if I open another VERTICAL buffer
(C-x 3) there is no line numbering for that buffer (this does't happen if I
open another HORIZONTAL buffer, C-x 2, as there is line numbering
accordingly). ANy help?
>
> 2. There is this weird bar alongside with the numbers (reminds me of the
annoying scrollbar). Is there a way to get rid of it?
>
> Thanks in advance.
>
> --
> John Kliff Jochens <jk-listas@bol.com.br>
>
>
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: soft wrapping and line numbers
  2003-05-01 22:44   ` Stefan Monnier
@ 2003-05-02 19:06     ` Roodwriter
  2003-05-02 21:23       ` Stefan Monnier
  2003-05-03 17:32       ` Kai Großjohann
  0 siblings, 2 replies; 11+ messages in thread
From: Roodwriter @ 2003-05-02 19:06 UTC (permalink / raw)


Stefan Monnier wrote:

>>>>>> "Roodwriter@core" == Roodwriter@core com <Roodwriter@core.com>
>>>>>> writes:
>> Refill also has problems with tabs--indenting everything.
> 
> I'm not sure what you're referring to here.  Could you expand on it
> a little ?
> 
>> That's not a bad way to work if you're like me and tend to hit the caps
>> lock when you're reaching for the tab key. But if you want your text to
>> have proper tabs you can do my Handy-Dandy, Patented, Kludgey, Little
>> Genius Workaround.
> 
> You might want to try longlines.el which does the same as your workaround
> but differently and allows you to deal with short unwrapped lines (using
> use-hard-newlines).
> 
> 
>         Stefan


I hope I'm remembering all this correctly. It's been about a year.

With the refill mode in standard text mode using the tab, the tab will tab 
every line right after that. With paragraph-indent-text-mode I had problems 
with the size of the tab indents varying. That is, sometimes they might be 
the equivalent of eight spaces, sometimes five. Cutting and pasting from 
DOS files seemed to exacerbate this. Sometimes they'd be spaces rather than 
actual tabs. Since the original files were tabbed, and not spaced, I don't 
know why this is. It also did this with just general cut and pasting within 
the file.

I'm a writer so I just switched to writing in the TeX style of 
double-spacing between paragraphs using regular text mode instead of 
tabbing. Then I use the macro I described to convert it to long lines when 
I'm finished. I send out my work by e-mail so I don't want shortlines when 
I'm pasting into the e-mail program. This could result in the receiver 
getting weird line breaks.

One of the side benefits, that I mentioned, was that I have a lot less 
trouble with hitting the caps-lock when I'm reaching for the tab. So I'm 
getting in the habit of working this way. Lots less capital cleanup.

I also had to make three companion macros. One that removes tabs and 
converts everything back to double-spaced paragraph form. Another to paste 
copied text in a filled manner, so I don't have to go back and fill it 
manually. And another to unfill paragraphs for times when I DO need to keep 
things in the double-space form.

For what it's worth, I'm using version 21.1.1. Maybe there's a better answer 
out there and I didn't have to go to all this trouble. Maybe I just 
displayed my ignorance in front of the world. But it still seems to me like 
the most sophisticated editor in the world should have the basic capability 
of wordwrap without newlines. Like I said, Windows Notepad can handle it. 
Emacs should also. I suspect it would become a whole lot more popular among 
writers if it could do this without going to a lot of trouble.

I was reluctant to even say anything to the first poster--probably I 
shouldn't--because, since Emacs is a free program, I feel like an ingrate 
complaining about it.

--Rod

-- 
Author of "Linux for Non-Geeks--Clear-eyed Answers for Practical Consumers" 
and "Boring Stories from Uncle Rod." Both are available at 
http://www.rodwriterpublishing.com/index.html

To reply by e-mail, take the extra "o" out of my e-mail address. It's to 
confuse spambots, of course.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: soft wrapping and line numbers
  2003-05-02 19:06     ` Roodwriter
@ 2003-05-02 21:23       ` Stefan Monnier
  2003-05-04 14:38         ` Oliver Scholz
  2003-05-03 17:32       ` Kai Großjohann
  1 sibling, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2003-05-02 21:23 UTC (permalink / raw)


> With the refill mode in standard text mode using the tab, the tab will tab
> every line right after that.

Indeed (unless you manually untab the second line, sine the lines after the
second are indented like the second).

> With paragraph-indent-text-mode I had problems with the size of the tab
> indents varying. That is, sometimes they might be  the equivalent of eight
> spaces, sometimes five. Cutting and pasting from  DOS files seemed to
> exacerbate this. Sometimes they'd be spaces rather than  actual
> tabs. Since the original files were tabbed, and not spaced, I don't  know
> why this is. It also did this with just general cut and pasting within
> the file.

Sounds like bugs.

> For what it's worth, I'm using version 21.1.1. Maybe there's a better answer
> out there and I didn't have to go to all this trouble. Maybe I just
> displayed my ignorance in front of the world. But it still seems to me like
> the most sophisticated editor in the world should have the basic capability
> of wordwrap without newlines. Like I said, Windows Notepad can handle it.
> Emacs should also. I suspect it would become a whole lot more popular among
> writers if it could do this without going to a lot of trouble.

Emacs is still pretty strongly aimed at "editing fixed-width 80 column
text".  I suspect most Emacs hackers still use it mostly in that
kind of context and are hence not strongly interested in improving it
in the direction you'd like it to go.

Another problem is that soft-wrapping as in Notepad tends to be of very
limited use when you want indented paragraphs or quoted paragraphs,
and so you quickly end up needing something more like Word where
there is a notion of page-width, margin and where the document is not
purely text but has various formatting info embedded in it.

It's probably not *that* hard to add soft-wrapping, but it looks
like none of the few people able to do it have any serious interest in such
a feature.


        Stefan

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: soft wrapping and line numbers
  2003-05-02 19:06     ` Roodwriter
  2003-05-02 21:23       ` Stefan Monnier
@ 2003-05-03 17:32       ` Kai Großjohann
  1 sibling, 0 replies; 11+ messages in thread
From: Kai Großjohann @ 2003-05-03 17:32 UTC (permalink / raw)


"Roodwriter@core.com" <Roodwriter@core.com> writes:

> I'm a writer so I just switched to writing in the TeX style of 
> double-spacing between paragraphs using regular text mode instead of 
> tabbing. Then I use the macro I described to convert it to long lines when 
> I'm finished. I send out my work by e-mail so I don't want shortlines when 
> I'm pasting into the e-mail program. This could result in the receiver 
> getting weird line breaks.

You could try longlines.el.  It will create files with long lines.
Those can be inserted into the email without a lot of trouble, I'd
think.

However, I think that longlines.el might not be handling the empty
lines very well.  So you'd get a long line for the first paragraph,
then an empty line, then a long line for the second paragraph, and so
on.  But maybe you can live with this.

-- 
file-error; Data: (Opening input file no such file or directory ~/.signature)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: soft wrapping and line numbers
  2003-05-02 21:23       ` Stefan Monnier
@ 2003-05-04 14:38         ` Oliver Scholz
  0 siblings, 0 replies; 11+ messages in thread
From: Oliver Scholz @ 2003-05-04 14:38 UTC (permalink / raw)


"Stefan Monnier" <monnier+gnu.emacs.help/news/@flint.cs.yale.edu> writes:

[...]
> Emacs is still pretty strongly aimed at "editing fixed-width 80 column
> text".  I suspect most Emacs hackers still use it mostly in that
> kind of context and are hence not strongly interested in improving it
> in the direction you'd like it to go.
>
> Another problem is that soft-wrapping as in Notepad tends to be of very
> limited use when you want indented paragraphs or quoted paragraphs,
> and so you quickly end up needing something more like Word where
> there is a notion of page-width, margin and where the document is not
> purely text but has various formatting info embedded in it.
[...]

I often wish Emacs would support some kind of CSS- or XSL-style area
model. Would it be very hard to implement with the current display
engine? Is it possible at all.

    Oliver
-- 
15 Floréal an 211 de la Révolution
Liberté, Egalité, Fraternité!

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2003-05-04 14:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <b8mjep$8b2$1@acs2.byu.edu>
2003-04-29 23:54 ` soft wrapping and line numbers Johan Bockgård
2003-04-30 13:53 ` Javier Oviedo
2003-05-01 14:45   ` John Kliff Jochens
     [not found]   ` <mailman.5444.1051801721.21513.help-gnu-emacs@gnu.org>
2003-05-02 14:25     ` Javier Oviedo
2003-04-30 14:41 ` Kai Großjohann
2003-04-30 18:20 ` Roodwriter
2003-05-01 22:44   ` Stefan Monnier
2003-05-02 19:06     ` Roodwriter
2003-05-02 21:23       ` Stefan Monnier
2003-05-04 14:38         ` Oliver Scholz
2003-05-03 17:32       ` Kai Großjohann

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.