all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* line numbers
@ 2003-01-07  4:33 Matthew Low
  2003-01-07  8:10 ` Benjamin Lewis
  0 siblings, 1 reply; 36+ messages in thread
From: Matthew Low @ 2003-01-07  4:33 UTC (permalink / raw)


I'm using Emacs 21.2.1. Is there any way to display line numbers on the
screen as you are typing?

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

* Re: line numbers
  2003-01-07  4:33 line numbers Matthew Low
@ 2003-01-07  8:10 ` Benjamin Lewis
  2003-01-07 20:17   ` Tuomo Takkula
                     ` (3 more replies)
  0 siblings, 4 replies; 36+ messages in thread
From: Benjamin Lewis @ 2003-01-07  8:10 UTC (permalink / raw)


Matthew Low wrote:

> I'm using Emacs 21.2.1. Is there any way to display line numbers on the
> screen as you are typing?

Yes:

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

I'm curious why you want this, though.  I've noticed a number of people
asking about this, and can't see where it would be useful, given some of
emacs' other features.

-- 
Benjamin Lewis

A small, but vocal, contingent even argues that tin is superior, but they
are held by most to be the lunatic fringe of Foil Deflector Beanie science.

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

* Re: line numbers
  2003-01-07  8:10 ` Benjamin Lewis
@ 2003-01-07 20:17   ` Tuomo Takkula
  2003-01-07 20:43     ` Benjamin Lewis
  2003-01-07 22:27   ` Bruce Korb
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 36+ messages in thread
From: Tuomo Takkula @ 2003-01-07 20:17 UTC (permalink / raw)


Benjamin Lewis <bclewis@cs.sfu.ca> writes:

> Matthew Low wrote:
> 
> > I'm using Emacs 21.2.1. Is there any way to display line numbers on the
> > screen as you are typing?
> 
> Yes:
> 
> http://www.emacswiki.org/cgi-bin/wiki.pl?LineNumbers
> 
> I'm curious why you want this, though.  I've noticed a number of people
> asking about this, and can't see where it would be useful, given some of
> emacs' other features.
> 

and personally I prefer to have the current line in the
modeline. Saves a few of these precious columns of editor space...

(setq-default line-number-mode t)


        Cheers
        Tuomo
--
Chalmers University of Technology
Computing Science
Eklandagatan 86, S-41296 Göteborg, Sweden
tuomo@cs.chalmers.se, +46-31-772 1052 phone, +46-31-165 655 fax

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

* Re: line numbers
  2003-01-07 20:17   ` Tuomo Takkula
@ 2003-01-07 20:43     ` Benjamin Lewis
  2003-01-13  8:44       ` Lee Sau Dan
  0 siblings, 1 reply; 36+ messages in thread
From: Benjamin Lewis @ 2003-01-07 20:43 UTC (permalink / raw)


Tuomo Takkula wrote:

> Benjamin Lewis <bclewis@cs.sfu.ca> writes:
> 
>> Matthew Low wrote:
>> 
>>> I'm using Emacs 21.2.1. Is there any way to display line numbers on the
>>> screen as you are typing?
>> 
>> Yes:
>> 
>> http://www.emacswiki.org/cgi-bin/wiki.pl?LineNumbers
>> 
>> I'm curious why you want this, though.  I've noticed a number of people
>> asking about this, and can't see where it would be useful, given some of
>> emacs' other features.
>> 
> 
> and personally I prefer to have the current line in the
> modeline. Saves a few of these precious columns of editor space...
> 
> (setq-default line-number-mode t)

Exactly.  This and things like M-x goto-line (bound to a convenient
function key), and being able to jump directly to or cycle through coding
errors from the compilation buffer, obviate the need for me to see the line
numbers in the buffer itself.

This doesn't necessarily mean it's not useful for everyone, though, which
was why I asked the question.  Or perhaps the original poster is satisfied
with line numbers on the modeline; the question is vague enough that this
is unclear.

-- 
Benjamin Lewis

Work is the curse of the drinking classes.
		-- Mike Romanoff

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

* Re: line numbers
  2003-01-07  8:10 ` Benjamin Lewis
  2003-01-07 20:17   ` Tuomo Takkula
@ 2003-01-07 22:27   ` Bruce Korb
  2003-01-09  2:45   ` Matthew Low
       [not found]   ` <mailman.42.1041986128.21513.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 36+ messages in thread
From: Bruce Korb @ 2003-01-07 22:27 UTC (permalink / raw)
  Cc: help-gnu-emacs

Benjamin Lewis wrote:
> 
> Matthew Low wrote:
> 
> > I'm using Emacs 21.2.1. Is there any way to display line numbers on the
> > screen as you are typing?
> 
> Yes:
> 
> http://www.emacswiki.org/cgi-bin/wiki.pl?LineNumbers
> 
> I'm curious why you want this, though.  I've noticed a number of people
> asking about this, and can't see where it would be useful, given some of
> emacs' other features.

Because sometimes I want to X-clip a block of text with line numbers
and email or print it.  In the end, I fire up vi.  Doing this in emacs
is too non-obvious.

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

* Re: line numbers
       [not found]   ` <mailman.42.1041986128.21513.help-gnu-emacs@gnu.org>
@ 2003-01-08 12:12     ` Reiner Steib
  2003-01-13  8:44     ` Lee Sau Dan
  1 sibling, 0 replies; 36+ messages in thread
From: Reiner Steib @ 2003-01-08 12:12 UTC (permalink / raw)


On Tue, Jan 07 2003, Bruce Korb wrote:

> Because sometimes I want to X-clip a block of text with line numbers
> and email or print it.  In the end, I fire up vi.  Doing this in
> emacs is too non-obvious.

`C-u M-| nl RET' might be your friend (for e-mail).

,----[ C-h k M-| ]
| M-| runs the command shell-command-on-region
|    which is an interactive compiled Lisp function in `simple'.
| (shell-command-on-region START END COMMAND &optional OUTPUT-BUFFER
| REPLACE ERROR-BUFFER)
| 
| Execute string COMMAND in inferior shell with region as input.
| Normally display output (if any) in temp buffer `*Shell Command Output*';
| Prefix arg means replace the region with it.  Return the exit code of
| COMMAND. [...]
`----

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/

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

* Re: line numbers
  2003-01-07  8:10 ` Benjamin Lewis
  2003-01-07 20:17   ` Tuomo Takkula
  2003-01-07 22:27   ` Bruce Korb
@ 2003-01-09  2:45   ` Matthew Low
  2003-01-09  5:18     ` Benjamin Lewis
       [not found]   ` <mailman.42.1041986128.21513.help-gnu-emacs@gnu.org>
  3 siblings, 1 reply; 36+ messages in thread
From: Matthew Low @ 2003-01-09  2:45 UTC (permalink / raw)


I meant to show line numbers for every line on display, for example down
the left margin of the screen. I'll implement this program as soon as I
learn to use .el files. Thanks a lot.

Matthew Low


On Tue, 7 Jan 2003, Benjamin Lewis wrote:

> Matthew Low wrote:
>
> > I'm using Emacs 21.2.1. Is there any way to display line numbers on the
> > screen as you are typing?
>
> Yes:
>
> http://www.emacswiki.org/cgi-bin/wiki.pl?LineNumbers
>
> I'm curious why you want this, though.  I've noticed a number of people
> asking about this, and can't see where it would be useful, given some of
> emacs' other features.
>
> --
> Benjamin Lewis
>
> A small, but vocal, contingent even argues that tin is superior, but they
> are held by most to be the lunatic fringe of Foil Deflector Beanie science.
>

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

* Re: line numbers
  2003-01-09  2:45   ` Matthew Low
@ 2003-01-09  5:18     ` Benjamin Lewis
  0 siblings, 0 replies; 36+ messages in thread
From: Benjamin Lewis @ 2003-01-09  5:18 UTC (permalink / raw)


Matthew Low wrote:

> On Tue, 7 Jan 2003, Benjamin Lewis wrote:
> 
>> Matthew Low wrote:
>> 
>>> I'm using Emacs 21.2.1. Is there any way to display line numbers on the
>>> screen as you are typing?
>> 
>> Yes:
>> 
>> http://www.emacswiki.org/cgi-bin/wiki.pl?LineNumbers
>> 
>> I'm curious why you want this, though.  I've noticed a number of people
>> asking about this, and can't see where it would be useful, given some of
>> emacs' other features.
> 
> I meant to show line numbers for every line on display, for example down
> the left margin of the screen. I'll implement this program as soon as I
> learn to use .el files. Thanks a lot.

That's what I thought you meant.  You don't have to do anything fancy; just
put the file setnu.el somewhere in your load path, and do M-x setnu-mode.

Actually, you probably also need a (require 'setnu) in your .emacs file.

-- 
Benjamin Lewis

Although the moon is smaller than the earth, it is farther away.

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

* Re: line numbers
  2003-01-07 20:43     ` Benjamin Lewis
@ 2003-01-13  8:44       ` Lee Sau Dan
  0 siblings, 0 replies; 36+ messages in thread
From: Lee Sau Dan @ 2003-01-13  8:44 UTC (permalink / raw)


>>>>> "Benjamin Lewis" == Benjamin Lewis <bclewis@cs.sfu.ca> writes:

    Benjamin Lewis> Exactly.  This and things like M-x goto-line
    Benjamin Lewis> (bound to a convenient function key), and being
    Benjamin Lewis> able to jump directly to or cycle through coding
    Benjamin Lewis> errors from the compilation buffer, obviate the
    Benjamin Lewis> need for me to see the line numbers in the buffer
    Benjamin Lewis> itself.

Owing to  influence from  Borlands text-mode IDE's,  I've bound  F8 to
#'next-error, F7 to '#previous-error and F9 to #'compile.  Here are my
~/.emacs lines to do these:

        (global-set-key '[f7] #'previous-error)
        (global-set-key '[f8] #'next-error)
        (global-set-key '[f9] #'compile)

No rocket science at all.



-- 
Lee Sau Dan                     李守敦(Big5)                    ~{@nJX6X~}(HZ) 

E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee

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

* Re: line numbers
       [not found]   ` <mailman.42.1041986128.21513.help-gnu-emacs@gnu.org>
  2003-01-08 12:12     ` Reiner Steib
@ 2003-01-13  8:44     ` Lee Sau Dan
  2003-01-14 18:27       ` Kevin Rodgers
  1 sibling, 1 reply; 36+ messages in thread
From: Lee Sau Dan @ 2003-01-13  8:44 UTC (permalink / raw)


>>>>> "Bruce" == Bruce Korb <bkorb@veritas.com> writes:

    Bruce> Because sometimes I want to X-clip a block of text with
    Bruce> line numbers and email or print it.  In the end, I fire up
    Bruce> vi.  Doing this in emacs is too non-obvious.

M-< M->  M-| cat -n RET  and then do  whatever you like in  the *Shell
Command Output* buffer.


Of course, if you  need to do this 5 times a  day, you should write it
in elisp.  :)


-- 
Lee Sau Dan                     李守敦(Big5)                    ~{@nJX6X~}(HZ) 

E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee

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

* Re: line numbers
  2003-01-13  8:44     ` Lee Sau Dan
@ 2003-01-14 18:27       ` Kevin Rodgers
  2003-01-20  7:50         ` Lee Sau Dan
  0 siblings, 1 reply; 36+ messages in thread
From: Kevin Rodgers @ 2003-01-14 18:27 UTC (permalink / raw)


Lee Sau Dan wrote:

>>>>>>"Bruce" == Bruce Korb <bkorb@veritas.com> writes:
>>>>>>
> 
>     Bruce> Because sometimes I want to X-clip a block of text with
>     Bruce> line numbers and email or print it.  In the end, I fire up
>     Bruce> vi.  Doing this in emacs is too non-obvious.
> 
> M-< M->  M-| cat -n RET  and then do  whatever you like in  the *Shell
> Command Output* buffer.

I find `C-x h' easier than `M-< M->'.  See the "Marking Objects" node in the
Emacs manual for similar useful commands.

-- 
<a href="mailto:&lt;kevin.rodgers&#64;ihs.com&gt;">Kevin Rodgers</a>

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

* RE: line numbers
@ 2003-01-16 17:24 andrew.maguire
  0 siblings, 0 replies; 36+ messages in thread
From: andrew.maguire @ 2003-01-16 17:24 UTC (permalink / raw)
  Cc: bkorb


> Lee Sau Dan wrote:
> 
> >>>>>>"Bruce" == Bruce Korb <bkorb@veritas.com> writes:
> >     Bruce> Because sometimes I want to X-clip a block of text with
> >     Bruce> line numbers and email or print it.  In the end, 
> I fire up
> >     Bruce> vi.  Doing this in emacs is too non-obvious.
> > 
> > M-< M->  M-| cat -n RET  and then do  whatever you like in  
> the *Shell
> > Command Output* buffer.
> 
> I find `C-x h' easier than `M-< M->'.  See the "Marking 
> Objects" node in the
> Emacs manual for similar useful commands.

You could use Occur mode with a simple regexp, e.g. ".".

Andrew

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

* Re: line numbers
  2003-01-14 18:27       ` Kevin Rodgers
@ 2003-01-20  7:50         ` Lee Sau Dan
  0 siblings, 0 replies; 36+ messages in thread
From: Lee Sau Dan @ 2003-01-20  7:50 UTC (permalink / raw)


>>>>> "Kevin" == Kevin Rodgers <kevin.rodgers@ihs.com> writes:

    Kevin> I find `C-x h' easier than `M-< M->'.  See the "Marking
    Kevin> Objects" node in the Emacs manual for similar useful
    Kevin> commands.

Oh1  Thanks.  I've  never discovered  this despite  10 years  of using
Emacs!  :P



-- 
Lee Sau Dan                     李守敦(Big5)                    ~{@nJX6X~}(HZ) 

E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee

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

* line numbers
@ 2006-04-30 22:11 Gary Wessle
  2006-05-01  2:43 ` Giorgos Keramidas
                   ` (2 more replies)
  0 siblings, 3 replies; 36+ messages in thread
From: Gary Wessle @ 2006-04-30 22:11 UTC (permalink / raw)


Hi

who can I place numbers of lines to the left of a paragraph so when I
copy/paste, the numbers stays with the text?

thanks

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

* Re: line numbers
  2006-04-30 22:11 Gary Wessle
@ 2006-05-01  2:43 ` Giorgos Keramidas
  2006-05-01  3:55   ` Cameron Desautels
       [not found]   ` <mailman.1166.1146455721.9609.help-gnu-emacs@gnu.org>
  2006-05-01  6:33 ` Fredrik Bulow
  2006-05-01  6:39 ` Burton Samograd
  2 siblings, 2 replies; 36+ messages in thread
From: Giorgos Keramidas @ 2006-05-01  2:43 UTC (permalink / raw)


On 01 May 2006 08:11:53 +1000, Gary Wessle <phddas@yahoo.com> wrote:
> Hi
> who can I place numbers of lines to the left of a paragraph so when I
> copy/paste, the numbers stays with the text?

I don't know if there's an easier way, but I usually filter the
buffer through ``cat -n'' and copy the resulting numbered lines
that I need.

	M-< M-> C-u M-| cat -n RET

	;; beginning-of-buffer
	;; end-of-buffer
	;; prefix , shell-command-on-region "cat -n"

When a prefix is passed to it (even an empty prefix), the
shell-command-on-region command runs the shell command, passing
the region as plain text input to it, and then replaces the
region with the output of the shell command.

- Giorgos

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

* Re: line numbers
  2006-05-01  2:43 ` Giorgos Keramidas
@ 2006-05-01  3:55   ` Cameron Desautels
       [not found]   ` <mailman.1166.1146455721.9609.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 36+ messages in thread
From: Cameron Desautels @ 2006-05-01  3:55 UTC (permalink / raw)


On Mon, May 01, 2006 at 05:43:25AM +0300, Giorgos Keramidas wrote:
> 	M-< M-> C-u M-| cat -n RET

You can shorten that just a hair to:
  C-x h C-u M-| cat -n RET
-- 
Cameron Desautels <cam@apt2324.com>


One kill-ring to push them all, and to C-w bind them.
 -- Joe Brenner <doom@kzsu.stanford.edu>, in alt.religion.emacs

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

* Re: line numbers
  2006-04-30 22:11 Gary Wessle
  2006-05-01  2:43 ` Giorgos Keramidas
@ 2006-05-01  6:33 ` Fredrik Bulow
  2006-05-01  6:39 ` Burton Samograd
  2 siblings, 0 replies; 36+ messages in thread
From: Fredrik Bulow @ 2006-05-01  6:33 UTC (permalink / raw)


Gary Wessle <phddas@yahoo.com> writes:

> Hi
>
> who can I place numbers of lines to the left of a paragraph so when I
> copy/paste, the numbers stays with the text?
>
> thanks

I don't understand what you want to do. Can you perhaps give us an
example?

/Fredrik

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

* Re: line numbers
  2006-04-30 22:11 Gary Wessle
  2006-05-01  2:43 ` Giorgos Keramidas
  2006-05-01  6:33 ` Fredrik Bulow
@ 2006-05-01  6:39 ` Burton Samograd
  2 siblings, 0 replies; 36+ messages in thread
From: Burton Samograd @ 2006-05-01  6:39 UTC (permalink / raw)


Gary Wessle <phddas@yahoo.com> writes:

> who can I place numbers of lines to the left of a paragraph so when I
> copy/paste, the numbers stays with the text?

http://www.emacswiki.org/cgi-bin/wiki/NumberLines

-- 
burton samograd					kruhft .at. gmail
kruhft.blogspot.com	www.myspace.com/kruhft	metashell.blogspot.com

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

* Re: line numbers
       [not found]   ` <mailman.1166.1146455721.9609.help-gnu-emacs@gnu.org>
@ 2006-05-02  9:42     ` Gary Wessle
  0 siblings, 0 replies; 36+ messages in thread
From: Gary Wessle @ 2006-05-02  9:42 UTC (permalink / raw)


Cameron Desautels <cam@apt2324.com> writes:

> On Mon, May 01, 2006 at 05:43:25AM +0300, Giorgos Keramidas wrote:
> > 	M-< M-> C-u M-| cat -n RET
> 
> You can shorten that just a hair to:
>   C-x h C-u M-| cat -n RET
> -- 

one problem with numbering the lines of a region selected by M-h is
that M-h seams to select the paragraph plus a line above the
paragraph.

so if this is a paragraph, hitting M-h here will highlight this
sentence and the previous line immediately before it.

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

* line numbers
@ 2012-06-03 17:36 Andrew Michael Levin
  2012-06-03 17:55 ` Michaël Bruneel
                   ` (2 more replies)
  0 siblings, 3 replies; 36+ messages in thread
From: Andrew Michael Levin @ 2012-06-03 17:36 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

How can I get line numbers to show up in emacs?

Andrew




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

* Re: line numbers
  2012-06-03 17:36 Andrew Michael Levin
@ 2012-06-03 17:55 ` Michaël Bruneel
  2012-06-03 18:18 ` Mark Skilbeck
  2012-06-04  6:30 ` Jai Dayal
  2 siblings, 0 replies; 36+ messages in thread
From: Michaël Bruneel @ 2012-06-03 17:55 UTC (permalink / raw)
  To: Andrew Michael Levin; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 347 bytes --]

Andrew,

In your ~/.emacs file, add the following line :

  (line-number-mode t) ; show line numbers

Regards,
Michaël

On Sun, Jun 03, 2012 at 07:36:27PM +0200, Andrew Michael Levin wrote:
> Hi,
> 
> How can I get line numbers to show up in emacs?
> 
> Andrew
> 
> 

-- 
Michaël Bruneel
+32 497 24 39 35 (BE)
www.alethes.be

[-- Attachment #2: Type: application/pgp-signature, Size: 230 bytes --]

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

* Re: line numbers
  2012-06-03 17:36 Andrew Michael Levin
  2012-06-03 17:55 ` Michaël Bruneel
@ 2012-06-03 18:18 ` Mark Skilbeck
  2012-06-03 19:02   ` Andrew Michael Levin
  2012-06-04 13:55   ` suvayu ali
  2012-06-04  6:30 ` Jai Dayal
  2 siblings, 2 replies; 36+ messages in thread
From: Mark Skilbeck @ 2012-06-03 18:18 UTC (permalink / raw)
  To: Andrew Michael Levin; +Cc: help-gnu-emacs

Adding to the previous reply suggesting line-number-mode, there are
also packages that show line-numbers *in the buffer* to which people
coming from outside Emacs are familiar. Depending on your Emacs
version, you may have the Linum package already installed. If so, M-x
linum-mode will interest you. Otherwise, you can find it on the
internet[1].

That said, I personally find the line-numbers along the left of a
buffer somewhat intrusive and unnecessary. The line-number shown in
the status area suffices and doesn't take up my precious screen space!

[1] http://emacswiki.org/emacs/LineNumbers#toc5

On Sun, Jun 03, 2012 at 07:36:27PM +0200, Andrew Michael Levin wrote:
> Hi,
> 
> How can I get line numbers to show up in emacs?
> 
> Andrew
> 

-- 
- mgsk.

if all you young men / were fish in the water 
how many young girls / would undress and dive after



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

* Re: line numbers
  2012-06-03 18:18 ` Mark Skilbeck
@ 2012-06-03 19:02   ` Andrew Michael Levin
  2012-06-03 19:08     ` Drew Adams
  2012-06-04  5:57     ` Bob Proulx
  2012-06-04 13:55   ` suvayu ali
  1 sibling, 2 replies; 36+ messages in thread
From: Andrew Michael Levin @ 2012-06-03 19:02 UTC (permalink / raw)
  To: Mark Skilbeck; +Cc: help-gnu-emacs

Hi,

So, what does

(line-number-mode t) ; show line numbers

do exactly? I added this to my .emacs and I don't see any change even
after I opened a new emacs session in a new terminal.

Andrew

On Sun, Jun 3, 2012 at 8:18 PM, Mark Skilbeck <m@iammark.us> wrote:
> Adding to the previous reply suggesting line-number-mode, there are
> also packages that show line-numbers *in the buffer* to which people
> coming from outside Emacs are familiar. Depending on your Emacs
> version, you may have the Linum package already installed. If so, M-x
> linum-mode will interest you. Otherwise, you can find it on the
> internet[1].
>
> That said, I personally find the line-numbers along the left of a
> buffer somewhat intrusive and unnecessary. The line-number shown in
> the status area suffices and doesn't take up my precious screen space!
>
> [1] http://emacswiki.org/emacs/LineNumbers#toc5
>
> On Sun, Jun 03, 2012 at 07:36:27PM +0200, Andrew Michael Levin wrote:
>> Hi,
>>
>> How can I get line numbers to show up in emacs?
>>
>> Andrew
>>
>
> --
> - mgsk.
>
> if all you young men / were fish in the water
> how many young girls / would undress and dive after
>




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

* RE: line numbers
  2012-06-03 19:02   ` Andrew Michael Levin
@ 2012-06-03 19:08     ` Drew Adams
  2012-06-04  5:57     ` Bob Proulx
  1 sibling, 0 replies; 36+ messages in thread
From: Drew Adams @ 2012-06-03 19:08 UTC (permalink / raw)
  To: 'Andrew Michael Levin', 'Mark Skilbeck'; +Cc: help-gnu-emacs

> So, what does
> (line-number-mode t) ; show line numbers
> do exactly?

C-h v line-number-mode

Emacs helps you if you learn to ask it.




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

* Re: line numbers
       [not found] <mailman.2202.1338745946.855.help-gnu-emacs@gnu.org>
@ 2012-06-03 19:36 ` Dan Espen
  2012-06-04  2:23   ` rusi
  2012-06-04  6:23 ` Christian Kellermann
  1 sibling, 1 reply; 36+ messages in thread
From: Dan Espen @ 2012-06-03 19:36 UTC (permalink / raw)
  To: help-gnu-emacs

Andrew Michael Levin <andrew.m.levin@vanderbilt.edu> writes:

> Hi,
>
> How can I get line numbers to show up in emacs?

line number mode shows the current line number in
the status bar.

But let me give my default advice:

If you think you need to see line numbers, you
may be doing something wrong.

Those line numbers you see on a failed compilation
can be accessed directly by running the compile
inside Emacs with M-x compile, and the line in error
can be accessed without a number with M-x next-error.

M-x grep has the same facilities.

I turn line number mode on, but I can't say I actually
look at line numbers very often.

-- 
Dan Espen


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

* Re: line numbers
  2012-06-03 19:36 ` Dan Espen
@ 2012-06-04  2:23   ` rusi
  0 siblings, 0 replies; 36+ messages in thread
From: rusi @ 2012-06-04  2:23 UTC (permalink / raw)
  To: help-gnu-emacs

On Jun 4, 12:36 am, Dan Espen <des...@verizon.net> wrote:
> Andrew Michael Levin <andrew.m.le...@vanderbilt.edu> writes:
>
> > Hi,
>
> > How can I get line numbers to show up in emacs?
>
> line number mode shows the current line number in
> the status bar.
>
> But let me give my default advice:
>
> If you think you need to see line numbers, you
> may be doing something wrong.
>
> Those line numbers you see on a failed compilation
> can be accessed directly by running the compile
> inside Emacs with M-x compile, and the line in error
> can be accessed without a number with M-x next-error.

Also you can go to a specific line with M-g g or M-g M-g


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

* Re: line numbers
  2012-06-03 19:02   ` Andrew Michael Levin
  2012-06-03 19:08     ` Drew Adams
@ 2012-06-04  5:57     ` Bob Proulx
  1 sibling, 0 replies; 36+ messages in thread
From: Bob Proulx @ 2012-06-04  5:57 UTC (permalink / raw)
  To: Andrew Michael Levin; +Cc: help-gnu-emacs

Andrew Michael Levin wrote:
> Mark Skilbeck wrote:
> > Adding to the previous reply suggesting line-number-mode, there are
> > also packages that show line-numbers *in the buffer* to which people
> > coming from outside Emacs are familiar. Depending on your Emacs
> > version, you may have the Linum package already installed. If so, M-x
> > linum-mode will interest you. Otherwise, you can find it on the
> > internet[1].
>
> So, what does
> 
> (line-number-mode t) ; show line numbers
> 
> do exactly? I added this to my .emacs and I don't see any change even
> after I opened a new emacs session in a new terminal.

You were asking for line numbers in the buffer so confusingly for you
line-number-mode is not what you want.  Mark suggested linum-mode not
line-number-mode.

  line-number-mode != linum-mode

line-number-mode turns on and off display of the line number in the
mode line bar at the bottom of screen.  The linum-mode package is
something different.  If you don't have it available you can load it
like this:

  $ wget http://web.student.tuwien.ac.at/~e0225855/linum/linum.el

Then load it into emacs:

  M-x load-file
  linum.el

Then activate it:

  M-x linum-mode

> > That said, I personally find the line-numbers along the left of a
> > buffer somewhat intrusive and unnecessary. The line-number shown in
> > the status area suffices and doesn't take up my precious screen space!

Agreed.  Since emacs doesn't rely upon line numbers the same way that
vi/ed did there isn't much attraction to have them visible all of the
time.  I find them distracting.  The line number in the mode line is
good for me.

Bob



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

* Re: line numbers
       [not found] <mailman.2202.1338745946.855.help-gnu-emacs@gnu.org>
  2012-06-03 19:36 ` Dan Espen
@ 2012-06-04  6:23 ` Christian Kellermann
  1 sibling, 0 replies; 36+ messages in thread
From: Christian Kellermann @ 2012-06-04  6:23 UTC (permalink / raw)
  To: help-gnu-emacs

Hi Andrew,

Andrew Michael Levin <andrew.m.levin@vanderbilt.edu> writes:
> How can I get line numbers to show up in emacs?

One alternative would be linum-mode (M-x linum-mode) but there are a
couple of options:

http://www.emacswiki.org/emacs/LineNumbers

HTH,

Christian


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

* Re: line numbers
  2012-06-03 17:36 Andrew Michael Levin
  2012-06-03 17:55 ` Michaël Bruneel
  2012-06-03 18:18 ` Mark Skilbeck
@ 2012-06-04  6:30 ` Jai Dayal
  2012-06-04 13:51   ` suvayu ali
  2 siblings, 1 reply; 36+ messages in thread
From: Jai Dayal @ 2012-06-04  6:30 UTC (permalink / raw)
  To: Andrew Michael Levin; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 438 bytes --]

Your first mistake was not realizing that this "community" consists of a
bunch of grumpy pedantic programmers working on trivial jobs.  They feel
small and insecure and the only way to remedy that is to put down people
who have a smaller knowledge base than they do.

On Sun, Jun 3, 2012 at 11:36 AM, Andrew Michael Levin <
andrew.m.levin@vanderbilt.edu> wrote:

> Hi,
>
> How can I get line numbers to show up in emacs?
>
> Andrew
>
>
>

[-- Attachment #2: Type: text/html, Size: 791 bytes --]

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

* Re: line numbers
  2012-06-04  6:30 ` Jai Dayal
@ 2012-06-04 13:51   ` suvayu ali
  2012-06-04 16:07     ` Jai Dayal
  0 siblings, 1 reply; 36+ messages in thread
From: suvayu ali @ 2012-06-04 13:51 UTC (permalink / raw)
  To: Emacs mailing list

Hello Jai,

On Mon, Jun 4, 2012 at 8:30 AM, Jai Dayal <dayalsoap@gmail.com> wrote:
> Your first mistake was not realizing that this "community" consists of a
> bunch of grumpy pedantic programmers working on trivial jobs.  They feel
> small and insecure and the only way to remedy that is to put down people who
> have a smaller knowledge base than they do.
>

And how is this relevant to the OP's question? If you are so displeased
with the community please feel free to unsubscribe from the list. No one
compelled you to be a part of it. However common Internet etiquette
requires you to be respectful of your peers. I request you to honour
that.

-- 
Suvayu

Open source is the future. It sets us free.



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

* Re: line numbers
  2012-06-03 18:18 ` Mark Skilbeck
  2012-06-03 19:02   ` Andrew Michael Levin
@ 2012-06-04 13:55   ` suvayu ali
  2012-06-04 14:56     ` Alp Aker
  1 sibling, 1 reply; 36+ messages in thread
From: suvayu ali @ 2012-06-04 13:55 UTC (permalink / raw)
  To: Mark Skilbeck; +Cc: help-gnu-emacs, Andrew Michael Levin

On Sun, Jun 3, 2012 at 8:18 PM, Mark Skilbeck <m@iammark.us> wrote:
> Adding to the previous reply suggesting line-number-mode, there are
> also packages that show line-numbers *in the buffer* to which people
> coming from outside Emacs are familiar. Depending on your Emacs
> version, you may have the Linum package already installed. If so, M-x
> linum-mode will interest you. Otherwise, you can find it on the
> internet[1].

A caveat. As far as I know linum mode shows line numbers using overlays.
This can be very expensive if the file is large (e.g. a log file, a
journal file etc). If possible I would advice the OP to adapt to not
using in-buffer line numbers and rely on line-number-mode for line
numbers on the mode line instead.

Hope this helps.

-- 
Suvayu

Open source is the future. It sets us free.



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

* Re: line numbers
  2012-06-04 13:55   ` suvayu ali
@ 2012-06-04 14:56     ` Alp Aker
  2012-06-04 15:28       ` suvayu ali
  0 siblings, 1 reply; 36+ messages in thread
From: Alp Aker @ 2012-06-04 14:56 UTC (permalink / raw)
  To: suvayu ali; +Cc: help-gnu-emacs, Andrew Michael Levin

On Mon, Jun 4, 2012 at 9:55 AM, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:

> A caveat. As far as I know linum mode shows line numbers using overlays.
> This can be very expensive if the file is large (e.g. a log file, a
> journal file etc). If possible I would advice the OP to adapt to not
> using in-buffer line numbers and rely on line-number-mode for line
> numbers on the mode line instead.

linum-mode only creates as many overlays as is needed to cover that
portion of a buffer that's visible at a given time; it removes them
from locations that are no longer visible.  As a result, its
performance is independent of buffer size.



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

* Re: line numbers
  2012-06-04 14:56     ` Alp Aker
@ 2012-06-04 15:28       ` suvayu ali
  0 siblings, 0 replies; 36+ messages in thread
From: suvayu ali @ 2012-06-04 15:28 UTC (permalink / raw)
  To: Alp Aker; +Cc: help-gnu-emacs, Andrew Michael Levin

On Mon, Jun 4, 2012 at 4:56 PM, Alp Aker <alptekin.aker@gmail.com> wrote:
> On Mon, Jun 4, 2012 at 9:55 AM, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
>
>> A caveat. As far as I know linum mode shows line numbers using overlays.
>> This can be very expensive if the file is large (e.g. a log file, a
>> journal file etc). If possible I would advice the OP to adapt to not
>> using in-buffer line numbers and rely on line-number-mode for line
>> numbers on the mode line instead.
>
> linum-mode only creates as many overlays as is needed to cover that
> portion of a buffer that's visible at a given time; it removes them
> from locations that are no longer visible.  As a result, its
> performance is independent of buffer size.

In the real world things can be very different. ;)

AFAIR, there is a long history of Heisenbug like issue with linum-mode
and large org-mode files. If you are interested you can check the
org-mode archive.

-- 
Suvayu

Open source is the future. It sets us free.



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

* Re: line numbers
  2012-06-04 13:51   ` suvayu ali
@ 2012-06-04 16:07     ` Jai Dayal
  2012-06-04 16:15       ` suvayu ali
  2012-06-04 16:24       ` Drew Adams
  0 siblings, 2 replies; 36+ messages in thread
From: Jai Dayal @ 2012-06-04 16:07 UTC (permalink / raw)
  To: suvayu ali; +Cc: Emacs mailing list

[-- Attachment #1: Type: text/plain, Size: 897 bytes --]

It's relevant to the rude replies the OP got.   How is that not clear?

On Mon, Jun 4, 2012 at 7:51 AM, suvayu ali <fatkasuvayu+linux@gmail.com>wrote:

> Hello Jai,
>
> On Mon, Jun 4, 2012 at 8:30 AM, Jai Dayal <dayalsoap@gmail.com> wrote:
> > Your first mistake was not realizing that this "community" consists of a
> > bunch of grumpy pedantic programmers working on trivial jobs.  They feel
> > small and insecure and the only way to remedy that is to put down people
> who
> > have a smaller knowledge base than they do.
> >
>
> And how is this relevant to the OP's question? If you are so displeased
> with the community please feel free to unsubscribe from the list. No one
> compelled you to be a part of it. However common Internet etiquette
> requires you to be respectful of your peers. I request you to honour
> that.
>
> --
> Suvayu
>
> Open source is the future. It sets us free.
>
>

[-- Attachment #2: Type: text/html, Size: 1376 bytes --]

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

* Re: line numbers
  2012-06-04 16:07     ` Jai Dayal
@ 2012-06-04 16:15       ` suvayu ali
  2012-06-04 16:24       ` Drew Adams
  1 sibling, 0 replies; 36+ messages in thread
From: suvayu ali @ 2012-06-04 16:15 UTC (permalink / raw)
  To: Emacs mailing list

On Mon, Jun 4, 2012 at 6:07 PM, Jai Dayal <dayalsoap@gmail.com> wrote:
> It's relevant to the rude replies the OP got.   How is that not clear?

Which response was the rude one again? I'm afraid you might be
mistaking terse for rude.

Anyway, this discussion is off-topic.

-- 
Suvayu

Open source is the future. It sets us free.



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

* RE: line numbers
  2012-06-04 16:07     ` Jai Dayal
  2012-06-04 16:15       ` suvayu ali
@ 2012-06-04 16:24       ` Drew Adams
  1 sibling, 0 replies; 36+ messages in thread
From: Drew Adams @ 2012-06-04 16:24 UTC (permalink / raw)
  To: 'Jai Dayal', 'suvayu ali'; +Cc: 'Emacs mailing list'

> It's relevant to the rude replies the OP got.
> How is that not clear?

I must be missing something.  All of the messages I saw were only helpful
AFAICT.

I did not save all of the messages from the thread, so I went here to look at
them again:
http://lists.gnu.org/archive/html/help-gnu-emacs/2012-06/msg00016.html

There is one message not shown there, marked "Message not available".  Maybe
that missing one was what you had in mind?  In any case, all of the other
messages seem well intended and helpful, to me.

That is, all of them except your message, which seemed to come from out of the
blue, and which complains about "grumpy pedantic programmers working on trivial
jobs" who "feel small and insecure and the only way to remedy that is to put
down people who have a smaller knowledge base than they do".

That does indeed seem rude, not to mention presumptuous.

I wonder if we are reading the same thread?  The thread I read does indeed show
evidence of a helpful `"community"'.
	





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

end of thread, other threads:[~2012-06-04 16:24 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-07  4:33 line numbers Matthew Low
2003-01-07  8:10 ` Benjamin Lewis
2003-01-07 20:17   ` Tuomo Takkula
2003-01-07 20:43     ` Benjamin Lewis
2003-01-13  8:44       ` Lee Sau Dan
2003-01-07 22:27   ` Bruce Korb
2003-01-09  2:45   ` Matthew Low
2003-01-09  5:18     ` Benjamin Lewis
     [not found]   ` <mailman.42.1041986128.21513.help-gnu-emacs@gnu.org>
2003-01-08 12:12     ` Reiner Steib
2003-01-13  8:44     ` Lee Sau Dan
2003-01-14 18:27       ` Kevin Rodgers
2003-01-20  7:50         ` Lee Sau Dan
  -- strict thread matches above, loose matches on Subject: below --
2003-01-16 17:24 andrew.maguire
2006-04-30 22:11 Gary Wessle
2006-05-01  2:43 ` Giorgos Keramidas
2006-05-01  3:55   ` Cameron Desautels
     [not found]   ` <mailman.1166.1146455721.9609.help-gnu-emacs@gnu.org>
2006-05-02  9:42     ` Gary Wessle
2006-05-01  6:33 ` Fredrik Bulow
2006-05-01  6:39 ` Burton Samograd
2012-06-03 17:36 Andrew Michael Levin
2012-06-03 17:55 ` Michaël Bruneel
2012-06-03 18:18 ` Mark Skilbeck
2012-06-03 19:02   ` Andrew Michael Levin
2012-06-03 19:08     ` Drew Adams
2012-06-04  5:57     ` Bob Proulx
2012-06-04 13:55   ` suvayu ali
2012-06-04 14:56     ` Alp Aker
2012-06-04 15:28       ` suvayu ali
2012-06-04  6:30 ` Jai Dayal
2012-06-04 13:51   ` suvayu ali
2012-06-04 16:07     ` Jai Dayal
2012-06-04 16:15       ` suvayu ali
2012-06-04 16:24       ` Drew Adams
     [not found] <mailman.2202.1338745946.855.help-gnu-emacs@gnu.org>
2012-06-03 19:36 ` Dan Espen
2012-06-04  2:23   ` rusi
2012-06-04  6:23 ` Christian Kellermann

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.