all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Go to a Line
@ 2003-03-20 16:32 nowar
  2003-03-20 16:36 ` Phillip Lord
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: nowar @ 2003-03-20 16:32 UTC (permalink / raw)


Hello

Is there any combination of keys to go to a specific line easily ?

Thanks. 

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

* Re: Go to a Line
  2003-03-20 16:32 nowar
@ 2003-03-20 16:36 ` Phillip Lord
  2003-03-20 19:04 ` Bijan Soleymani
  2003-03-20 19:04 ` Andrew Taylor
  2 siblings, 0 replies; 17+ messages in thread
From: Phillip Lord @ 2003-03-20 16:36 UTC (permalink / raw)


>>>>> "nowar" == nowar  <nowar@aol.com> writes:

  nowar> Hello Is there any combination of keys to go to a specific
  nowar> line easily ?



No there isn't, but many people use this in their .emacs, which binds
to C-cg

(global-set-key "\C-cg" 'goto-line)


It's worth mentioning that most of the time you don't need to do
this. Compile errors for instance are in many cases parsable by emacs,
and it will just jump to the right line for you. 

Cheers

Phil

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

* Re: Go to a Line
  2003-03-20 16:32 nowar
  2003-03-20 16:36 ` Phillip Lord
@ 2003-03-20 19:04 ` Bijan Soleymani
  2003-03-20 19:04 ` Andrew Taylor
  2 siblings, 0 replies; 17+ messages in thread
From: Bijan Soleymani @ 2003-03-20 19:04 UTC (permalink / raw)


nowar <nowar@aol.com> writes:

> Hello
> 
> Is there any combination of keys to go to a specific line easily ?

M-x goto-line
:)

If that's not convenient then simply bind it to some key:
(global-set-key "\C-cg" 'goto-line)
will bind goto-line to C-c g

Bijan

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

* Re: Go to a Line
  2003-03-20 16:32 nowar
  2003-03-20 16:36 ` Phillip Lord
  2003-03-20 19:04 ` Bijan Soleymani
@ 2003-03-20 19:04 ` Andrew Taylor
  2 siblings, 0 replies; 17+ messages in thread
From: Andrew Taylor @ 2003-03-20 19:04 UTC (permalink / raw)


nowar wrote:
> Hello
> 
> Is there any combination of keys to go to a specific line easily ?
> 
> Thanks. 

M-x goto-line

But if line you are looking for comes from the output of a compiler 
(error or warning message), or comes from grep, there is a better way. 
Consider using M-x compile to compile your source; then M-x ` will bring 
you each error in sequence (if you are using ant, make sure to use the 
-emacs command line option).  For grep, M-x grep does approximately the 
same thing.

-- 
Andrew

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

* Re: Go to a Line
@ 2003-03-20 19:12 Nick.Godbey
  2003-03-20 19:31 ` Bijan Soleymani
       [not found] ` <mailman.3434.1048188151.21513.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 17+ messages in thread
From: Nick.Godbey @ 2003-03-20 19:12 UTC (permalink / raw)
  Cc: help-gnu-emacs


Or you could just use the default key of

M-g

nick



                                                                                                                                            
                      Bijan Soleymani <bijan@psq.com>                                                                                       
                      Sent by:                                         To:       help-gnu-emacs@gnu.org                                     
                      help-gnu-emacs-bounces+nick.godbey=sita.a        cc:                                                                  
                      ero@gnu.org                                      Subject:  Re: Go to a Line                                           
                                                                                                                                            
                                                                                                                                            
                      03/20/2003 02:04 PM                                                                                                   
                                                                                                                                            
                                                                                                                                            




nowar <nowar@aol.com> writes:

> Hello
>
> Is there any combination of keys to go to a specific line easily ?

M-x goto-line
:)

If that's not convenient then simply bind it to some key:
(global-set-key "\C-cg" 'goto-line)
will bind goto-line to C-c g

Bijan
_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnu-emacs

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

* Re: Go to a Line
  2003-03-20 19:12 Go to a Line Nick.Godbey
@ 2003-03-20 19:31 ` Bijan Soleymani
       [not found] ` <mailman.3434.1048188151.21513.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 17+ messages in thread
From: Bijan Soleymani @ 2003-03-20 19:31 UTC (permalink / raw)
  Cc: help-gnu-emacs

Nick.Godbey@sita.aero writes:

> Or you could just use the default key of
> 
> M-g
> 
> nick

That is not the standard binding for M-g.
M-g by default is used to change font or something like that.

Bijan

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

* Re: Go to a Line
       [not found] ` <mailman.3434.1048188151.21513.help-gnu-emacs@gnu.org>
@ 2003-03-20 19:37   ` Kirsten Tremaine
  2003-03-26 13:23     ` Kai Großjohann
  0 siblings, 1 reply; 17+ messages in thread
From: Kirsten Tremaine @ 2003-03-20 19:37 UTC (permalink / raw)


In article <mailman.3434.1048188151.21513.help-gnu-emacs@gnu.org>,
Bijan Soleymani wrote: 
>> Or you could just use the default key of
>> 
>> M-g
> 
> That is not the standard binding for M-g.

It is in xemacs.  If you need to switch back and forth a lot between
the gnuemacs and xemacs, because some hosts only have one and some
only have the other, it's very handy to use the same binding in both.


> M-g by default is used to change font or something like that.

Exactly -- "or something like that".  It's a comparatively obscure
function vis-a-vis goto-line.  How often do you use the standard m-g
in gnuemacs?  For me the answer was "never".  Sounds like the same for
you.  So why not rebind it to goto-line and thereby have the same
binding in both emacs variants at minimal cost?

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

* Re: Go to a Line
       [not found] <mailman.3438.1048191376.21513.help-gnu-emacs@gnu.org>
@ 2003-03-21 13:29 ` Bijan Soleymani
  0 siblings, 0 replies; 17+ messages in thread
From: Bijan Soleymani @ 2003-03-21 13:29 UTC (permalink / raw)


Nick.Godbey@sita.aero writes:

> Or you could just use the default key of
> 
> M-g

I'm using emacs 21.2 and that's not the default binding for M-g. For
me M-g does something involving changing the face or something like
that.

Bijan

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

* Re: Go to a Line
  2003-03-20 19:37   ` Kirsten Tremaine
@ 2003-03-26 13:23     ` Kai Großjohann
  2003-03-26 16:04       ` Stefan Monnier
  0 siblings, 1 reply; 17+ messages in thread
From: Kai Großjohann @ 2003-03-26 13:23 UTC (permalink / raw)


Kirsten Tremaine <kitr@listen.fm> writes:

> Exactly -- "or something like that".  It's a comparatively obscure
> function vis-a-vis goto-line.  How often do you use the standard m-g
> in gnuemacs?  For me the answer was "never".  Sounds like the same for
> you.  So why not rebind it to goto-line and thereby have the same
> binding in both emacs variants at minimal cost?

I think that C-x g is a good choice because its default behavior of
insert-register can be had with C-x r g, too.

And C-x g is nicely mnemonic.
-- 
A preposition is not a good thing to end a sentence with.

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

* Re: Go to a Line
  2003-03-26 13:23     ` Kai Großjohann
@ 2003-03-26 16:04       ` Stefan Monnier
  2003-03-26 18:51         ` Bijan Soleymani
  0 siblings, 1 reply; 17+ messages in thread
From: Stefan Monnier @ 2003-03-26 16:04 UTC (permalink / raw)


> And C-x g is nicely mnemonic.

I use (and like) C-s because I'm "searching for line NNN".


        Stefan

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

* Re: Go to a Line
  2003-03-26 16:04       ` Stefan Monnier
@ 2003-03-26 18:51         ` Bijan Soleymani
  2003-03-26 19:10           ` Stefan Monnier
  0 siblings, 1 reply; 17+ messages in thread
From: Bijan Soleymani @ 2003-03-26 18:51 UTC (permalink / raw)


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

> > And C-x g is nicely mnemonic.
> 
> I use (and like) C-s because I'm "searching for line NNN".

But then you lose the normal binding of C-s: incremental searching. Of
course it depends which you do more often.

Bijan

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

* Re: Go to a Line
  2003-03-26 18:51         ` Bijan Soleymani
@ 2003-03-26 19:10           ` Stefan Monnier
  2003-03-27  5:20             ` Ivan Kanis
  0 siblings, 1 reply; 17+ messages in thread
From: Stefan Monnier @ 2003-03-26 19:10 UTC (permalink / raw)


>> > And C-x g is nicely mnemonic.
>> I use (and like) C-s because I'm "searching for line NNN".
> But then you lose the normal binding of C-s: incremental searching. Of

Nah: I hacked isearch to do the goto-line thingy instead ;-)


        Stefan

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

* Re: Go to a Line
  2003-03-26 19:10           ` Stefan Monnier
@ 2003-03-27  5:20             ` Ivan Kanis
  2003-03-27 16:14               ` Stefan Monnier
  0 siblings, 1 reply; 17+ messages in thread
From: Ivan Kanis @ 2003-03-27  5:20 UTC (permalink / raw)



    >>> > And C-x g is nicely mnemonic.
    >>> I use (and like) C-s because I'm "searching for line NNN".
    >> But then you lose the normal binding of C-s: incremental
    >> searching. Of

    Stefan> Nah: I hacked isearch to do the goto-line thingy instead

That is _really_ interesting. Does it scroll incrementally to the line
as you type the number? How do you search for numbers in a file? Do you mind
showing us the function you are using :)

Ivan
-- 
/-----------------------------------------------------------------------------*
|       "We turn, not older with years,       |           Ivan Kanis          |
|       but newer every day."                 |        ivank@juliva.com       |
|       (Emily Dickinson)                     |         www.juliva.com        |
*-----------------------------------------------------------------------------/

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

* Re: Go to a Line
  2003-03-27  5:20             ` Ivan Kanis
@ 2003-03-27 16:14               ` Stefan Monnier
  2003-03-27 20:38                 ` Kevin Rodgers
  0 siblings, 1 reply; 17+ messages in thread
From: Stefan Monnier @ 2003-03-27 16:14 UTC (permalink / raw)


Stefan> Nah: I hacked isearch to do the goto-line thingy instead
> That is _really_ interesting. Does it scroll incrementally to the line
> as you type the number?

Of course ;-)

> How do you search for numbers in a file?

The usual way: `123' matches both the string `123' and the line 123.
The only time when it's inconvenient is when you're looking for line 123 and
the buffer contains heaps of matches for the string `123'.

Also, there's the problem that you might need to hit C-s one extra
time to force isearch to wrap around (or you could have used C-r instead,
but the point is that the relative position of the starting point and the
destination line is relevant).

> Do you mind showing us the function you are using :)

It's a bunch of patches to isearch.el.  I'll see if I can extract the
relevant portions.


        Stefan

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

* Re: Go to a Line
  2003-03-27 16:14               ` Stefan Monnier
@ 2003-03-27 20:38                 ` Kevin Rodgers
  2003-03-27 21:05                   ` Stefan Monnier
  0 siblings, 1 reply; 17+ messages in thread
From: Kevin Rodgers @ 2003-03-27 20:38 UTC (permalink / raw)


Stefan Monnier wrote:

>>How do you search for numbers in a file?
> 
> The usual way: `123' matches both the string `123' and the line 123.
> The only time when it's inconvenient is when you're looking for line 123 and
> the buffer contains heaps of matches for the string `123'.

Hmmm, how about patching regex.c instead to match a new regular expression:


	\#N	would match the empty string anywhere on line N

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

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

* Re: Go to a Line
  2003-03-27 20:38                 ` Kevin Rodgers
@ 2003-03-27 21:05                   ` Stefan Monnier
  2003-03-27 22:26                     ` Kevin Rodgers
  0 siblings, 1 reply; 17+ messages in thread
From: Stefan Monnier @ 2003-03-27 21:05 UTC (permalink / raw)


> Hmmm, how about patching regex.c instead to match a new regular expression:
> 	\#N	would match the empty string anywhere on line N

Talk about a major gross hack!
I'll only forgive you if you promise you never heard about how regexp
matching is implemented.


        Stefan

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

* Re: Go to a Line
  2003-03-27 21:05                   ` Stefan Monnier
@ 2003-03-27 22:26                     ` Kevin Rodgers
  0 siblings, 0 replies; 17+ messages in thread
From: Kevin Rodgers @ 2003-03-27 22:26 UTC (permalink / raw)


Stefan Monnier wrote:

>>Hmmm, how about patching regex.c instead to match a new regular expression:
>>	\#N	would match the empty string anywhere on line N
> 
> Talk about a major gross hack!


How is that any worse than the other regexps that match the empty string at
various buffer positions: ^ $ \` \'


> I'll only forgive you if you promise you never heard about how regexp
> matching is implemented.

I promise, I don't know.

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

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

end of thread, other threads:[~2003-03-27 22:26 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-20 19:12 Go to a Line Nick.Godbey
2003-03-20 19:31 ` Bijan Soleymani
     [not found] ` <mailman.3434.1048188151.21513.help-gnu-emacs@gnu.org>
2003-03-20 19:37   ` Kirsten Tremaine
2003-03-26 13:23     ` Kai Großjohann
2003-03-26 16:04       ` Stefan Monnier
2003-03-26 18:51         ` Bijan Soleymani
2003-03-26 19:10           ` Stefan Monnier
2003-03-27  5:20             ` Ivan Kanis
2003-03-27 16:14               ` Stefan Monnier
2003-03-27 20:38                 ` Kevin Rodgers
2003-03-27 21:05                   ` Stefan Monnier
2003-03-27 22:26                     ` Kevin Rodgers
     [not found] <mailman.3438.1048191376.21513.help-gnu-emacs@gnu.org>
2003-03-21 13:29 ` Bijan Soleymani
  -- strict thread matches above, loose matches on Subject: below --
2003-03-20 16:32 nowar
2003-03-20 16:36 ` Phillip Lord
2003-03-20 19:04 ` Bijan Soleymani
2003-03-20 19:04 ` Andrew Taylor

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.