all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Does Emacs have a line-number function or is %l the only equivalent?
@ 2004-01-12 19:29 Christian Seberino
  2004-01-12 19:42 ` Henrik Enberg
  0 siblings, 1 reply; 6+ messages in thread
From: Christian Seberino @ 2004-01-12 19:29 UTC (permalink / raw)


Does Emacs have a line-number function or is %l the only equivalent?

I think XEmacs has line-number but not Emacs.

Chris

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

* Re: Does Emacs have a line-number function or is %l the only equivalent?
  2004-01-12 19:29 Does Emacs have a line-number function or is %l the only equivalent? Christian Seberino
@ 2004-01-12 19:42 ` Henrik Enberg
  2004-01-14 17:18   ` gebser
  0 siblings, 1 reply; 6+ messages in thread
From: Henrik Enberg @ 2004-01-12 19:42 UTC (permalink / raw)


seberino@spawar.navy.mil (Christian Seberino) writes:

> Does Emacs have a line-number function or is %l the only equivalent?

There is setnu.el, but it only works so so, I recall.

<http://www.wonderworks.com/download/setnu.el>

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

* Re: Does Emacs have a line-number function or is %l the only equivalent?
  2004-01-12 19:42 ` Henrik Enberg
@ 2004-01-14 17:18   ` gebser
  0 siblings, 0 replies; 6+ messages in thread
From: gebser @ 2004-01-14 17:18 UTC (permalink / raw)



Having

(setq-default line-number-mode t)

puts the number of the current line (the one the cursor is on) in the 
modeline.  Is that the sort of "function" you're referring to?


Name withheld because it's too much to type.


At 20:42 (UTC+0100) on Mon, 12 Jan 2004 Henrik Enberg said:

= seberino@spawar.navy.mil (Christian Seberino) writes:
= 
= > Does Emacs have a line-number function or is %l the only equivalent?
= 
= There is setnu.el, but it only works so so, I recall.
= 
= <http://www.wonderworks.com/download/setnu.el>
= _______________________________________________
= Help-gnu-emacs mailing list
= Help-gnu-emacs@gnu.org
= http://mail.gnu.org/mailman/listinfo/help-gnu-emacs
= 

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

* Re: Does Emacs have a line-number function or is %l the only equivalent?
       [not found] <mailman.651.1074102458.928.help-gnu-emacs@gnu.org>
@ 2004-01-15  3:45 ` Christian Seberino
  2004-01-15  4:23   ` Christopher J. White
  0 siblings, 1 reply; 6+ messages in thread
From: Christian Seberino @ 2004-01-15  3:45 UTC (permalink / raw)


gebser

I just wanted a function that returned the line number of
current point that I could use anywhere.

I need a function like %l I can use to return a number


e.g. (line-number)

Chris

P.S. I just want to replace %l with something clearer
in my .emacs.  That's all.

gebser@speakeasy.net wrote in message news:<mailman.651.1074102458.928.help-gnu-emacs@gnu.org>...
> Having
> 
> (setq-default line-number-mode t)
> 
> puts the number of the current line (the one the cursor is on) in the 
> modeline.  Is that the sort of "function" you're referring to?
> 
> 
> Name withheld because it's too much to type.
> 
> 
> At 20:42 (UTC+0100) on Mon, 12 Jan 2004 Henrik Enberg said:
> 
> = seberino@spawar.navy.mil (Christian Seberino) writes:
> = 
> = > Does Emacs have a line-number function or is %l the only equivalent?
> = 
> = There is setnu.el, but it only works so so, I recall.
> = 
> = <http://www.wonderworks.com/download/setnu.el>
> = _______________________________________________
> = Help-gnu-emacs mailing list
> = Help-gnu-emacs@gnu.org
> = http://mail.gnu.org/mailman/listinfo/help-gnu-emacs
> =

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

* Re: Does Emacs have a line-number function or is %l the only equivalent?
  2004-01-15  3:45 ` Christian Seberino
@ 2004-01-15  4:23   ` Christopher J. White
  2004-01-15 16:07     ` Kevin Rodgers
  0 siblings, 1 reply; 6+ messages in thread
From: Christopher J. White @ 2004-01-15  4:23 UTC (permalink / raw)


>>>>> "chris" == Christian Seberino <seberino@spawar.navy.mil> writes:

chris> I just wanted a function that returned the line number of
chris> current point that I could use anywhere.

How about (what-line)?

...cj

-- 
------------------------
-- Christopher J. White                                    
--
-- chris @ (---)
--   grierwhite . com
------------------------

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

* Re: Does Emacs have a line-number function or is %l the only equivalent?
  2004-01-15  4:23   ` Christopher J. White
@ 2004-01-15 16:07     ` Kevin Rodgers
  0 siblings, 0 replies; 6+ messages in thread
From: Kevin Rodgers @ 2004-01-15 16:07 UTC (permalink / raw)


Christopher J. White wrote:

>>>>>>"chris" == Christian Seberino <seberino@spawar.navy.mil> writes:
>>>>>>
> 
> chris> I just wanted a function that returned the line number of
> chris> current point that I could use anywhere.
> 
> How about (what-line)?

As its doc string says, it prints the line number (and more) in the echo

area.  Better is (count-lines (point-min) (point)), which actually returns
a number.  And if you want to ignore any narrowing that may be in effect,
you need to do

(save-restriction
   (widen)
   (count-lines (point-min) (point)))

-- 
Kevin Rodgers

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

end of thread, other threads:[~2004-01-15 16:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-12 19:29 Does Emacs have a line-number function or is %l the only equivalent? Christian Seberino
2004-01-12 19:42 ` Henrik Enberg
2004-01-14 17:18   ` gebser
     [not found] <mailman.651.1074102458.928.help-gnu-emacs@gnu.org>
2004-01-15  3:45 ` Christian Seberino
2004-01-15  4:23   ` Christopher J. White
2004-01-15 16:07     ` Kevin Rodgers

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.