unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* Feature Request: Relative jump using M-x goto-line
@ 2007-10-12 18:11 Sivaram Neelakantan
  2007-10-12 18:39 ` Michael Droettboom
  2007-10-12 18:39 ` Eric Hanchrow
  0 siblings, 2 replies; 8+ messages in thread
From: Sivaram Neelakantan @ 2007-10-12 18:11 UTC (permalink / raw)
  To: bug-gnu-emacs

Can M-x goto-line have options to take numbers with +- values, so that
it goes to line +lines from current position or -lines from current
position?

M-x goto-line +40, should go 40 lines forward
M-x goto-line -30  goes 30 lines backward.
M-x goto-line 24   goes to line 24

I'd find this useful when working with files having header and trailer
records. 


 sivaram
 -- 





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

* Re: Feature Request: Relative jump using M-x goto-line
       [not found] <mailman.1987.1192213301.18990.bug-gnu-emacs@gnu.org>
@ 2007-10-12 18:38 ` Jussi Piitulainen
  0 siblings, 0 replies; 8+ messages in thread
From: Jussi Piitulainen @ 2007-10-12 18:38 UTC (permalink / raw)
  To: gnu-emacs-bug

Sivaram Neelakantan writes:

> Can M-x goto-line have options to take numbers with +- values, so that
> it goes to line +lines from current position or -lines from current
> position?
> 
> M-x goto-line +40, should go 40 lines forward
> M-x goto-line -30  goes 30 lines backward.
> M-x goto-line 24   goes to line 24
> 
> I'd find this useful when working with files having header and trailer
> records. 

You can give an argument to C-n or C-p.

C-u 4 0 C-n
C-u 3 0 C-p
M-x goto-line RET 24




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

* Re: Feature Request: Relative jump using M-x goto-line
  2007-10-12 18:11 Feature Request: Relative jump using M-x goto-line Sivaram Neelakantan
@ 2007-10-12 18:39 ` Michael Droettboom
  2007-10-12 18:39 ` Eric Hanchrow
  1 sibling, 0 replies; 8+ messages in thread
From: Michael Droettboom @ 2007-10-12 18:39 UTC (permalink / raw)
  To: Sivaram Neelakantan; +Cc: bug-gnu-emacs

Maybe this doesn't address your needs, but you can do:

C-u 40 C-n to go 40 lines forward
C-u 30 C-p to go 30 lines backward

Cheers,
Mike

On 10/12/07, Sivaram Neelakantan <nsivaram.net@gmail.com> wrote:
> Can M-x goto-line have options to take numbers with +- values, so that
> it goes to line +lines from current position or -lines from current
> position?
>
> M-x goto-line +40, should go 40 lines forward
> M-x goto-line -30  goes 30 lines backward.
> M-x goto-line 24   goes to line 24
>
> I'd find this useful when working with files having header and trailer
> records.
>
>
>  sivaram
>  --
>
>
>
>
>


-- 
Michael Droettboom
http://www.droettboom.com/




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

* Re: Feature Request: Relative jump using M-x goto-line
  2007-10-12 18:11 Feature Request: Relative jump using M-x goto-line Sivaram Neelakantan
  2007-10-12 18:39 ` Michael Droettboom
@ 2007-10-12 18:39 ` Eric Hanchrow
  2007-10-12 19:13   ` Sivaram Neelakantan
       [not found]   ` <mailman.1990.1192216966.18990.bug-gnu-emacs@gnu.org>
  1 sibling, 2 replies; 8+ messages in thread
From: Eric Hanchrow @ 2007-10-12 18:39 UTC (permalink / raw)
  To: bug-gnu-emacs


    M-x goto-line +40, should go 40 lines forward

M-4 M-0 C-n

    M-x goto-line -30  goes 30 lines backward.

M-4 M-0 C-p





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

* Re: Feature Request: Relative jump using M-x goto-line
  2007-10-12 18:39 ` Eric Hanchrow
@ 2007-10-12 19:13   ` Sivaram Neelakantan
  2007-10-13 17:50     ` Jonathan Goldblatt
       [not found]   ` <mailman.1990.1192216966.18990.bug-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 8+ messages in thread
From: Sivaram Neelakantan @ 2007-10-12 19:13 UTC (permalink / raw)
  To: bug-gnu-emacs

Eric Hanchrow <offby1@blarg.net> writes:

>     M-x goto-line +40, should go 40 lines forward
>
> M-4 M-0 C-n
>
>     M-x goto-line -30  goes 30 lines backward.
>
> M-4 M-0 C-p

You're trying to put me off from using Emacs, aren't you? :-)

That's the most intuitive key chord sequence I've seen in a long
time. :-) 

I've already goto goto-line mapped to C-z, all it needs is something
to do relative movement. Not this, please!

 sivaram
 -- 





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

* Re: Feature Request: Relative jump using M-x goto-line
  2007-10-12 19:13   ` Sivaram Neelakantan
@ 2007-10-13 17:50     ` Jonathan Goldblatt
  0 siblings, 0 replies; 8+ messages in thread
From: Jonathan Goldblatt @ 2007-10-13 17:50 UTC (permalink / raw)
  To: Sivaram Neelakantan; +Cc: bug-gnu-emacs

>>>>> "Sivaram" == Sivaram Neelakantan <nsivaram.net@gmail.com> writes:

    Sivaram> Not this, please!

You might want to try this... You can put it in your .emacs

(defun sivaram-goto-line (line)
  "Special goto-line for sivaram."
  (interactive "s")
  (yow t)
  (if (string-match "^\\+\\|-" line)
      (next-line (string-to-int line))
    (goto-line (string-to-int line))))
(global-set-key "\x1a" 'sivaram-goto-line)

It's a little rough, but I'm sure that you can make it do what
you want it to.

Jonathan






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

* Re: Feature Request: Relative jump using M-x goto-line
       [not found]   ` <mailman.1990.1192216966.18990.bug-gnu-emacs@gnu.org>
@ 2007-10-15 15:15     ` Mathias Dahl
  2007-10-15 18:04       ` Sivaram Neelakantan
  0 siblings, 1 reply; 8+ messages in thread
From: Mathias Dahl @ 2007-10-15 15:15 UTC (permalink / raw)
  To: gnu-emacs-bug

Sivaram Neelakantan <nsivaram.net@gmail.com> writes:

>> M-4 M-0 C-p
>
> You're trying to put me off from using Emacs, aren't you? :-)
>
> That's the most intuitive key chord sequence I've seen in a long
> time. :-) 

How about this then:

C-2 C-0 C-n, that is, keep Ctrl down and type 2 0 n. That's like three
and a half keypress, could it be shorter to jump 20 lines forward? :)




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

* Re: Feature Request: Relative jump using M-x goto-line
  2007-10-15 15:15     ` Mathias Dahl
@ 2007-10-15 18:04       ` Sivaram Neelakantan
  0 siblings, 0 replies; 8+ messages in thread
From: Sivaram Neelakantan @ 2007-10-15 18:04 UTC (permalink / raw)
  To: bug-gnu-emacs

Mathias Dahl <brakjoller@gmail.com> writes:

> Sivaram Neelakantan <nsivaram.net@gmail.com> writes:
>
>>> M-4 M-0 C-p
>>
>> You're trying to put me off from using Emacs, aren't you? :-)
>>
>> That's the most intuitive key chord sequence I've seen in a long
>> time. :-) 
>
> How about this then:
>
> C-2 C-0 C-n, that is, keep Ctrl down and type 2 0 n. That's like three
> and a half keypress, could it be shorter to jump 20 lines forward? :)
>
>
>

*surrenders*

Note to self; Live with the damned bindings.  :-)

 sivaram
 -- 





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

end of thread, other threads:[~2007-10-15 18:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-12 18:11 Feature Request: Relative jump using M-x goto-line Sivaram Neelakantan
2007-10-12 18:39 ` Michael Droettboom
2007-10-12 18:39 ` Eric Hanchrow
2007-10-12 19:13   ` Sivaram Neelakantan
2007-10-13 17:50     ` Jonathan Goldblatt
     [not found]   ` <mailman.1990.1192216966.18990.bug-gnu-emacs@gnu.org>
2007-10-15 15:15     ` Mathias Dahl
2007-10-15 18:04       ` Sivaram Neelakantan
     [not found] <mailman.1987.1192213301.18990.bug-gnu-emacs@gnu.org>
2007-10-12 18:38 ` Jussi Piitulainen

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).