all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Does emacs have a line numbering feature?
@ 2007-09-07 15:42 arguellodw
  2007-09-07 15:51 ` Drew Adams
  2007-09-07 16:02 ` Michaël Cadilhac
  0 siblings, 2 replies; 19+ messages in thread
From: arguellodw @ 2007-09-07 15:42 UTC (permalink / raw)
  To: Help-gnu-emacs


How is this feature toggled on and off?
-- 
View this message in context: http://www.nabble.com/Does-emacs-have-a-line-numbering-feature--tf4401994.html#a12557810
Sent from the Emacs - Help mailing list archive at Nabble.com.

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

* RE: Does emacs have a line numbering feature?
  2007-09-07 15:42 Does emacs have a line numbering feature? arguellodw
@ 2007-09-07 15:51 ` Drew Adams
  2007-09-08  7:46   ` brianjiang
  2007-09-07 16:02 ` Michaël Cadilhac
  1 sibling, 1 reply; 19+ messages in thread
From: Drew Adams @ 2007-09-07 15:51 UTC (permalink / raw)
  To: Help-gnu-emacs

> How is this feature toggled on and off?

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

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

* Re: Does emacs have a line numbering feature?
  2007-09-07 15:42 Does emacs have a line numbering feature? arguellodw
  2007-09-07 15:51 ` Drew Adams
@ 2007-09-07 16:02 ` Michaël Cadilhac
  1 sibling, 0 replies; 19+ messages in thread
From: Michaël Cadilhac @ 2007-09-07 16:02 UTC (permalink / raw)
  To: arguellodw; +Cc: Help-gnu-emacs


[-- Attachment #1.1: Type: text/plain, Size: 468 bytes --]

arguellodw <arguellodw@yahoo.com> writes:

> How is this feature toggled on and off?

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

-- 
 |   Michaël `Micha' Cadilhac       |   An error can become exact            |
 |   http://michael.cadilhac.name   |     as the one who committed it        |
 |   JID/MSN:                       |  made a mistake or not.                |
 `----  michael.cadilhac@gmail.com  |          -- Pierre Dac            -  --'

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

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

* Re: Does emacs have a line numbering feature?
       [not found] <mailman.454.1189179783.18990.help-gnu-emacs@gnu.org>
@ 2007-09-07 20:44 ` Tassilo Horn
  2007-09-12  8:56 ` Andrew Russell
  1 sibling, 0 replies; 19+ messages in thread
From: Tassilo Horn @ 2007-09-07 20:44 UTC (permalink / raw)
  To: help-gnu-emacs

arguellodw <arguellodw@yahoo.com> writes:

> How is this feature toggled on and off?

,----[ C-h f line-number-mode RET ]
| line-number-mode is an interactive compiled Lisp function in `simple.el'.
| It is bound to <menu-bar> <options> <showhide> <line-number-mode>.
| (line-number-mode &optional ARG)
| 
| Toggle Line Number mode.
| With arg, turn Line Number mode on if arg is positive, otherwise
| turn it off.  When Line Number mode is enabled, the line number
| appears in the mode line.
| 
| Line numbers do not appear for very large buffers and buffers
| with very long lines; see variables `line-number-display-limit'
| and `line-number-display-limit-width'.
`----

If the line number in the mode-line is not enough, maybe

  http://www.emacswiki.org/cgi-bin/wiki/setnu.el

is something fod you.

Bye,
Tassilo

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

* RE: Does emacs have a line numbering feature?
  2007-09-07 15:51 ` Drew Adams
@ 2007-09-08  7:46   ` brianjiang
  2007-09-08 14:37     ` Drew Adams
  0 siblings, 1 reply; 19+ messages in thread
From: brianjiang @ 2007-09-08  7:46 UTC (permalink / raw)
  To: drew.adams, Help-gnu-emacs

Thanks for the link. I try the "linum.el" mentioned in the link. It is very faster than setnu.el. 
I try linum mode in a file has 115000 lines, the line number show immediately. When I try setnu in the same file, my Emacs crashed!

quote from the link:
Linum

Library linum.el works incrementally and can number large files very fast.

http://stud4.tuwien.ac.at/~e0225855/linum/linum.html

 

-----Original Message-----
From: help-gnu-emacs-bounces+brianjiang=gdnt.com.cn@gnu.org [mailto:help-gnu-emacs-bounces+brianjiang=gdnt.com.cn@gnu.org] On Behalf Of Drew Adams
Sent: 2007年9月7日 23:51
To: Help-gnu-emacs@gnu.org
Subject: RE: Does emacs have a line numbering feature?

> How is this feature toggled on and off?

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


_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

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

* RE: Does emacs have a line numbering feature?
  2007-09-08  7:46   ` brianjiang
@ 2007-09-08 14:37     ` Drew Adams
  2007-09-08 15:53       ` brianjiang
  0 siblings, 1 reply; 19+ messages in thread
From: Drew Adams @ 2007-09-08 14:37 UTC (permalink / raw)
  To: Help-gnu-emacs

> Thanks for the link. I try the "linum.el" mentioned in the link.
> It is very faster than setnu.el.
> I try linum mode in a file has 115000 lines, the line number show
> immediately. When I try setnu in the same file, my Emacs crashed!
>
> quote from the link:
> Linum
>
> Library linum.el works incrementally and can number large files very fast.
>
> http://stud4.tuwien.ac.at/~e0225855/linum/linum.html
>
> > How is this feature toggled on and off?
> >
> http://www.emacswiki.org/cgi-bin/wiki/LineNumbers

I agree. As I said on that page, Linum seems to be an improvement over
Setnu. Suggestion: post your performance figures on the wiki, so that others
can benefit from it.

Wrt your Setnu crash - please report the bug, if you can reproduce it,
starting with emacs -Q (that is, without .emacs).

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

* RE: Does emacs have a line numbering feature?
  2007-09-08 14:37     ` Drew Adams
@ 2007-09-08 15:53       ` brianjiang
  2007-09-08 20:42         ` Drew Adams
  0 siblings, 1 reply; 19+ messages in thread
From: brianjiang @ 2007-09-08 15:53 UTC (permalink / raw)
  To: drew.adams, Help-gnu-emacs

I will post my my figures on the wiki later. I never edited wiki before and don't know to do it now. 

The crash can be reproduced even I starting emacs with -Q option. The file I used to test has 115000 lines and its size is about 15M.
The error message is: "Emacs Clipboard: emacs.exe -Application Error". I use WIN XP SP2 and the computer has 2G memory.
My emacs version is:
This is GNU Emacs 22.1.1 (i386-mingw-nt5.1.2600)
 of 2007-06-02 on RELEASE

The version of My copy of setnum.el is (Maybe out of date):
(defconst setnu-mode-version "1.06" ...

BTW:
I have taken a look at the code of  linum.el. The linum.el uses a very simple approach to show the line number and it only makes overlays for the line visible in the screen. So it runs very fast and consumes less memory.  The codes are very simple and have only about 100 lines (including comments).

 

-----Original Message-----
From: help-gnu-emacs-bounces+brianjiang=gdnt.com.cn@gnu.org [mailto:help-gnu-emacs-bounces+brianjiang=gdnt.com.cn@gnu.org] On Behalf Of Drew Adams
Sent: 2007年9月8日 22:37
To: Help-gnu-emacs@gnu.org
Subject: RE: Does emacs have a line numbering feature?

> Thanks for the link. I try the "linum.el" mentioned in the link.
> It is very faster than setnu.el.
> I try linum mode in a file has 115000 lines, the line number show 
> immediately. When I try setnu in the same file, my Emacs crashed!
>
> quote from the link:
> Linum
>
> Library linum.el works incrementally and can number large files very fast.
>
> http://stud4.tuwien.ac.at/~e0225855/linum/linum.html
>
> > How is this feature toggled on and off?
> >
> http://www.emacswiki.org/cgi-bin/wiki/LineNumbers

I agree. As I said on that page, Linum seems to be an improvement over Setnu. Suggestion: post your performance figures on the wiki, so that others can benefit from it.

Wrt your Setnu crash - please report the bug, if you can reproduce it, starting with emacs -Q (that is, without .emacs).




_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

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

* RE: Does emacs have a line numbering feature?
  2007-09-08 15:53       ` brianjiang
@ 2007-09-08 20:42         ` Drew Adams
  0 siblings, 0 replies; 19+ messages in thread
From: Drew Adams @ 2007-09-08 20:42 UTC (permalink / raw)
  To: Help-gnu-emacs

> I will post my my figures on the wiki later. I never edited wiki
> before and don't know to do it now.

There's nothing to it. Click the "Edit this page" link, type your additional
text, click Preview to check that it looks OK, then click Save.

> The crash can be reproduced even I starting emacs with -Q option.
> The file I used to test has 115000 lines and its size is about 15M.
> The error message is: "Emacs Clipboard: emacs.exe -Application
> Error". I use WIN XP SP2 and the computer has 2G memory.
> My emacs version is:
> This is GNU Emacs 22.1.1 (i386-mingw-nt5.1.2600)
>  of 2007-06-02 on RELEASE

Sounds like it might be a memory problem. But I imagine that Emacs shouldn't
just crash.

If you can narrow this down a bit, that would be good. In any case, please
report it using M-x report-emacs-bug (starting from emacs -Q).

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

* Re: Does emacs have a line numbering feature?
       [not found] <mailman.456.1189180395.18990.help-gnu-emacs@gnu.org>
@ 2007-09-09  7:24 ` Unknown
  2007-09-09 11:06   ` saint
       [not found]   ` <mailman.561.1189336001.18990.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 19+ messages in thread
From: Unknown @ 2007-09-09  7:24 UTC (permalink / raw)
  To: help-gnu-emacs

Drew Adams, on 09/07/2007 11:51 AM said:
>> How is this feature toggled on and off?
> 
> http://www.emacswiki.org/cgi-bin/wiki/LineNumbers
> 

Is there a way to make that the default---say, automatically put Emacs
into linum-mode for every buffer created?  This would be a very useful
thing for me.

	-- Mike

-- 
Michael B. Trausch                                http://www.trausch.us/
Pidgin 2.1.1 and plugins for Ubuntu Feisty!
(And Thunderbird 2.0.0.6, too!)             http://www.trausch.us/pidgin

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

* Re: Does emacs have a line numbering feature?
  2007-09-09  7:24 ` Unknown
@ 2007-09-09 11:06   ` saint
       [not found]   ` <mailman.561.1189336001.18990.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 19+ messages in thread
From: saint @ 2007-09-09 11:06 UTC (permalink / raw)
  To: help-gnu-emacs

uoting Michael Trausch <"mike|s/\x40/\./g;s/|.*|/\x40/g;|trausch"@us.eng.it>:

> Drew Adams, on 09/07/2007 11:51 AM said:
>>> How is this feature toggled on and off?
>>
>> http://www.emacswiki.org/cgi-bin/wiki/LineNumbers
>>
>
> Is there a way to make that the default---say, automatically put Emacs
> into linum-mode for every buffer created?  This would be a very useful
> thing for me.

As for line-number-mode (the one I use) put this in .emacs - there's  
that for columns too...

(setq line-number-mode t)
(setq column-number-mode t)


--
  /\           ___
/___/\_|_|\_|__|___Gian Uberto Lauri_____
   //--\| | \|  |   Integralista GNUslamico
\/                 e coltivatore diretto di Software

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

* Re: Does emacs have a line numbering feature?
       [not found]   ` <mailman.561.1189336001.18990.help-gnu-emacs@gnu.org>
@ 2007-09-09 16:09     ` Unknown
  2007-09-09 20:14       ` Tassilo Horn
  0 siblings, 1 reply; 19+ messages in thread
From: Unknown @ 2007-09-09 16:09 UTC (permalink / raw)
  To: help-gnu-emacs

saint@eng.it, on 09/09/2007 07:06 AM said:
> 
> (setq line-number-mode t)
> (setq column-number-mode t)
> 

Yeah, I already had that in, and it works.  However, if I do something
similar for linum-mode, it seems to just ignore it.

	-- Mike

-- 
Michael B. Trausch                                http://www.trausch.us/
Pidgin 2.1.1 and plugins for Ubuntu Feisty!
(And Thunderbird 2.0.0.6, too!)             http://www.trausch.us/pidgin

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

* Re: Does emacs have a line numbering feature?
  2007-09-09 16:09     ` Unknown
@ 2007-09-09 20:14       ` Tassilo Horn
  2007-09-09 22:00         ` Unknown
  0 siblings, 1 reply; 19+ messages in thread
From: Tassilo Horn @ 2007-09-09 20:14 UTC (permalink / raw)
  To: help-gnu-emacs

Michael Trausch <"mike|s/\x40/\./g;s/|.*|/\x40/g;|trausch"@us> writes:

Hi Michael,

>> (setq line-number-mode t)
>> (setq column-number-mode t)
>
> Yeah, I already had that in, and it works.  However, if I do something
> similar for linum-mode, it seems to just ignore it.

Yes, because setting a minor mode variable to activate it is the wrong
thing to do.  It might work sometimes, but generally you should either
customize the variable or use the minor mode function.  So the code
above should better be

  (line-number-mode 1)
  (column-number-mode 1)

because by convention a minor mode is turned on if the argument is
positive.

Bye,
Tassilo
-- 
Chuck  Norris  was  banned  from  competitive bullriding  after  a  1992
exhibition in San Antonio, when he  rode the bull 1,346 miles from Texas
to Milwaukee Wisconsin to pick up his dry cleaning.

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

* Re: Does emacs have a line numbering feature?
  2007-09-09 20:14       ` Tassilo Horn
@ 2007-09-09 22:00         ` Unknown
  2007-09-09 22:58           ` Drew Adams
  0 siblings, 1 reply; 19+ messages in thread
From: Unknown @ 2007-09-09 22:00 UTC (permalink / raw)
  To: help-gnu-emacs

Tassilo Horn, on 09/09/2007 04:14 PM said:
>>> (setq line-number-mode t)
>>> (setq column-number-mode t)
>> Yeah, I already had that in, and it works.  However, if I do something
>> similar for linum-mode, it seems to just ignore it.
> 
> Yes, because setting a minor mode variable to activate it is the wrong
> thing to do.  It might work sometimes, but generally you should either
> customize the variable or use the minor mode function.  So the code
> above should better be
> 
>   (line-number-mode 1)
>   (column-number-mode 1)
> 
> because by convention a minor mode is turned on if the argument is
> positive.
> 

Okay... I tried that, too, for linum-mode, and it doesn't work.  Am I
missing something obvious or am I an idiot?  :-P

	-- Mike

-- 
Michael B. Trausch                                http://www.trausch.us/
Pidgin 2.1.1 and plugins for Ubuntu Feisty!
(And Thunderbird 2.0.0.6, too!)             http://www.trausch.us/pidgin

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

* RE: Does emacs have a line numbering feature?
  2007-09-09 22:00         ` Unknown
@ 2007-09-09 22:58           ` Drew Adams
  2007-09-10  3:11             ` brianjiang
  0 siblings, 1 reply; 19+ messages in thread
From: Drew Adams @ 2007-09-09 22:58 UTC (permalink / raw)
  To: Michael Trausch, help-gnu-emacs

> >>> (setq line-number-mode t)
> >>> (setq column-number-mode t)
> >> Yeah, I already had that in, and it works.  However, if I do something
> >> similar for linum-mode, it seems to just ignore it.
> >
> > Yes, because setting a minor mode variable to activate it is the wrong
> > thing to do.  It might work sometimes, but generally you should either
> > customize the variable or use the minor mode function.  So the code
> > above should better be
> >
> >   (line-number-mode 1)
> >   (column-number-mode 1)
> >
> > because by convention a minor mode is turned on if the argument is
> > positive.
> >
>
> Okay... I tried that, too, for linum-mode, and it doesn't work.  Am I
> missing something obvious or am I an idiot?  :-P

Linum mode is a local minor mode: turning it on does so only for the current
buffer.

Are you using Emacs 22? If so, then you can define a different command,
`global-linum-mode', as follows (after loading linum.el):

(define-globalized-minor-mode global-linum-mode
   linum-mode (lambda nil (linum-mode 1)))

Then just put this in your .emacs: (global-linum-mode 1).

You can toggle line numbering in all buffers at once using command
`global-linum-mode'. Even the minibuffer is affected, which might not be
what you want.

You might ask Markus to add this command to the library.

If you don't have Emacs 22, then you will probably need to turn on the
(local) mode in each buffer, using a hook.

HTH.

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

* Re: Does emacs have a line numbering feature?
       [not found] <mailman.597.1189378773.18990.help-gnu-emacs@gnu.org>
@ 2007-09-09 23:31 ` Unknown
  2007-09-10  1:41   ` David Kastrup
  0 siblings, 1 reply; 19+ messages in thread
From: Unknown @ 2007-09-09 23:31 UTC (permalink / raw)
  To: help-gnu-emacs

Drew Adams, on 09/09/2007 06:58 PM said:
> 
> Are you using Emacs 22? If so, then you can define a different command,
> `global-linum-mode', as follows (after loading linum.el):
> 
> (define-globalized-minor-mode global-linum-mode
>    linum-mode (lambda nil (linum-mode 1)))
> 
> Then just put this in your .emacs: (global-linum-mode 1).
> 
> You can toggle line numbering in all buffers at once using command
> `global-linum-mode'. Even the minibuffer is affected, which might not be
> what you want.
>

A small price to pay, given that having linum is about one of the only
things that I was really left wishing for.  :)  Now, if I could just
find a computer chip to implant in my brain that would teach me LISP... :-)

Thank you!

	-- Mike

-- 
Michael B. Trausch                                http://www.trausch.us/
Pidgin 2.1.1 and plugins for Ubuntu Feisty!
(And Thunderbird 2.0.0.6, too!)             http://www.trausch.us/pidgin

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

* Re: Does emacs have a line numbering feature?
  2007-09-09 23:31 ` Unknown
@ 2007-09-10  1:41   ` David Kastrup
  0 siblings, 0 replies; 19+ messages in thread
From: David Kastrup @ 2007-09-10  1:41 UTC (permalink / raw)
  To: help-gnu-emacs

Michael Trausch <"mike|s/\x40/\./g;s/|.*|/\x40/g;|trausch"@us> writes:

> Drew Adams, on 09/09/2007 06:58 PM said:
>> 
>> Are you using Emacs 22? If so, then you can define a different command,
>> `global-linum-mode', as follows (after loading linum.el):
>> 
>> (define-globalized-minor-mode global-linum-mode
>>    linum-mode (lambda nil (linum-mode 1)))
>> 
>> Then just put this in your .emacs: (global-linum-mode 1).
>> 
>> You can toggle line numbering in all buffers at once using command
>> `global-linum-mode'. Even the minibuffer is affected, which might not be
>> what you want.
>>
>
> A small price to pay, given that having linum is about one of the
> only things that I was really left wishing for.  :) Now, if I could
> just find a computer chip to implant in my brain that would teach me
> LISP... :-)

It is usually sufficient to obliterate any recollection of C.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* RE: Does emacs have a line numbering feature?
  2007-09-09 22:58           ` Drew Adams
@ 2007-09-10  3:11             ` brianjiang
  0 siblings, 0 replies; 19+ messages in thread
From: brianjiang @ 2007-09-10  3:11 UTC (permalink / raw)
  To: drew.adams, "mike|s/\\x40/\\./g; s/|.*|/\\x40/g;|trausch",
	help-gnu-emacs

I find sometimes the line number doesn't show. e.g., open a file, then use "occur" to find a text string and click occur buffer to jump to the next occurrence of string in another page, then the line number doesn't show. When I click the file buffer, the line numbers then show.

I find it is because the linum.el uses "window-start" and "window-end" to determine the which text lines are visible currently. But they are sometimes not reliable. See the text from the "help":

     Redisplay updates the window-start position (if you have not
     specified it explicitly since the previous redisplay)--for
     example, to make sure point appears on the screen.  Nothing except
     redisplay automatically changes the window-start position; if you
     move point, do not expect the window-start position to change in
     response until after the next redisplay.

So I change something in the linum.el as below. And it currently works well for me. Maybe there are some better solutions I don't know.

(defun linum-update ()
  "Update displayed line numbers for the current buffer."
  (save-excursion
    ;;(goto-char (window-start))            ;; brian: comment out
    (let (;;(line (line-number-at-pos))     ;; brian
          ;;(limit (1+ (window-end nil t))) ;; brian
          line
          limit
          pos
          w-h
          w-s
          (fmt (if (stringp linum-format) linum-format (linum-dynamic-format)))
          ov
          free)

      ;; brian: hack it...........................
      (setq pos (point))
      (setq w-s (window-start))
      (setq limit (1+ (window-end nil t)) )
      (when (or (> pos limit)
                (< pos w-s))
        (setq w-h (window-height))
        (forward-line w-h)
        (setq limit (point))
        ;; don't worry about nagitive position
        (goto-char pos)
        (forward-line (- 0 w-h))
        (setq w-s (point))
        )
      (goto-char w-s)
      (setq line (line-number-at-pos))
      ;; brian: end of hacking.....................
      
      (dolist (ov (overlays-in (point) limit))
        (when (overlay-get ov 'linum)
          (push ov free)))
      ;; Create an overlay (or reuse an existing one) for each visible
      ;; line in this window.
      (while (and (not (eobp)) (< (point) limit))
        (if (null free)
            (progn
              (setq ov (make-overlay (point) (point)))
              (overlay-put ov 'linum t)
              (push ov linum-overlays))
          (setq ov (pop free))
          (move-overlay ov (point) (point)))
        (overlay-put ov 'before-string (format fmt line))
        (overlay-put ov 'margin 'left-margin)
        (forward-line)
        (setq line (1+ line)))
      (mapc #'delete-overlay free))))


Regards,
Brian


-----Original Message-----
From: help-gnu-emacs-bounces+brianjiang=gdnt.com.cn@gnu.org [mailto:help-gnu-emacs-bounces+brianjiang=gdnt.com.cn@gnu.org] On Behalf Of Drew Adams
Sent: 2007年9月10日 6:59
To: Michael Trausch; help-gnu-emacs@gnu.org
Subject: RE: Does emacs have a line numbering feature?

> >>> (setq line-number-mode t)
> >>> (setq column-number-mode t)
> >> Yeah, I already had that in, and it works.  However, if I do 
> >> something similar for linum-mode, it seems to just ignore it.
> >
> > Yes, because setting a minor mode variable to activate it is the 
> > wrong thing to do.  It might work sometimes, but generally you 
> > should either customize the variable or use the minor mode function.  
> > So the code above should better be
> >
> >   (line-number-mode 1)
> >   (column-number-mode 1)
> >
> > because by convention a minor mode is turned on if the argument is 
> > positive.
> >
>
> Okay... I tried that, too, for linum-mode, and it doesn't work.  Am I 
> missing something obvious or am I an idiot?  :-P

Linum mode is a local minor mode: turning it on does so only for the current buffer.

Are you using Emacs 22? If so, then you can define a different command, `global-linum-mode', as follows (after loading linum.el):

(define-globalized-minor-mode global-linum-mode
   linum-mode (lambda nil (linum-mode 1)))

Then just put this in your .emacs: (global-linum-mode 1).

You can toggle line numbering in all buffers at once using command `global-linum-mode'. Even the minibuffer is affected, which might not be what you want.

You might ask Markus to add this command to the library.

If you don't have Emacs 22, then you will probably need to turn on the
(local) mode in each buffer, using a hook.

HTH.



_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

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

* Re: Does emacs have a line numbering feature?
       [not found] <mailman.608.1189394026.18990.help-gnu-emacs@gnu.org>
@ 2007-09-10  4:24 ` Markus Triska
  0 siblings, 0 replies; 19+ messages in thread
From: Markus Triska @ 2007-09-10  4:24 UTC (permalink / raw)
  To: help-gnu-emacs

<brianjiang@gdnt.com.cn> writes:

> So I change something in the linum.el as below. And it currently
> works well for me. Maybe there are some better solutions I don't

Please try version 0.9a (for Emacs >= 22) from the linum page; it
implements a different solution which I hope works better for you.

All the best,
Markus

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

* Re: Does emacs have a line numbering feature?
       [not found] <mailman.454.1189179783.18990.help-gnu-emacs@gnu.org>
  2007-09-07 20:44 ` Tassilo Horn
@ 2007-09-12  8:56 ` Andrew Russell
  1 sibling, 0 replies; 19+ messages in thread
From: Andrew Russell @ 2007-09-12  8:56 UTC (permalink / raw)
  To: help-gnu-emacs

Thanks to everybody who has made posts on this question. I have learnt 
alot, and solved my long standing problems. (I am new to this group)

-- 
The box said windows XP or better, so i bought a Mac!!

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

end of thread, other threads:[~2007-09-12  8:56 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-07 15:42 Does emacs have a line numbering feature? arguellodw
2007-09-07 15:51 ` Drew Adams
2007-09-08  7:46   ` brianjiang
2007-09-08 14:37     ` Drew Adams
2007-09-08 15:53       ` brianjiang
2007-09-08 20:42         ` Drew Adams
2007-09-07 16:02 ` Michaël Cadilhac
     [not found] <mailman.454.1189179783.18990.help-gnu-emacs@gnu.org>
2007-09-07 20:44 ` Tassilo Horn
2007-09-12  8:56 ` Andrew Russell
     [not found] <mailman.456.1189180395.18990.help-gnu-emacs@gnu.org>
2007-09-09  7:24 ` Unknown
2007-09-09 11:06   ` saint
     [not found]   ` <mailman.561.1189336001.18990.help-gnu-emacs@gnu.org>
2007-09-09 16:09     ` Unknown
2007-09-09 20:14       ` Tassilo Horn
2007-09-09 22:00         ` Unknown
2007-09-09 22:58           ` Drew Adams
2007-09-10  3:11             ` brianjiang
     [not found] <mailman.597.1189378773.18990.help-gnu-emacs@gnu.org>
2007-09-09 23:31 ` Unknown
2007-09-10  1:41   ` David Kastrup
     [not found] <mailman.608.1189394026.18990.help-gnu-emacs@gnu.org>
2007-09-10  4:24 ` Markus Triska

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.