[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Suggestion: Mapping of M-g should be goto-line

From: Danilo Segan
Subject: Re: Suggestion: Mapping of M-g should be goto-line
Date: Thu, 25 Mar 2004 12:23:34 +0100
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (gnu/linux)

Hi Jari,  Lucas, Juanma,

Today at 11:32, Jari Aalto wrote:

> * Thu 2004-03-25 Danilo Segan <dsegan <AT> gmx.net> mail.default.spool
> | Today at 7:11, Jari Aalto wrote:
> | 
> | >         If put side by side, "set face default" and goto-line, I would
> | >         estimate that the 99 % of the cases, there is more need for
> | >         goto-line. Therefore it would be better if the M-g was mapped
> | >         to it. 
> | 
> | Emacs tries hard to make goto-line unnecessary, AFAICT.  Can you
> | provide an example of when goto-line couldn't be replaced with a
> | better functionality (such as using M-x next-error)? 
> Only if user knows Emacs. He doesn't when he is a beginner. And even
> long period of Emacs experience, people still run many, many programs
> outside of emacs in their terminals.

That's only a reason to educate them better, not to adjust behaviour.
Emacs is not too friendly to beginners at all -- they'd need to
relearn a lot of things, no matter what editor they used before (if
it wasn't Emacs).  This is only one minor point in all the effort
they'll need to expend.

At the same time, Lucas writes:
> >
> > FWIW, C-x ` is bound to next-error, and it's a big win in situations
> > like this.
> And, ` is on AltGR 7 here, so basically absolutely unusable on French
> keyboard layouts. Of course next-error is bound to something else

Which would only go so far to recommend assigning M-g to next-error,
perhaps? ;)

Also, Jari mentioned this example:

> Emacs is no substitute for all system tasks. It is a great companion,
> but I believe only handful of people do _all_ from inside Emacs and
> not ever open a single terminal.
> So, line numbers come from everywhere. You might be running 3-5 server
> screen, shared samba mounts, then you see error in next screen and want
> to view it in Emacs that contains the log file or configuration file ...
> the needs are many.

...which complements what Juanma Barranquero wrote:

> Some people, like me, doesn't do everything inside Emacs. I rarely, if
> ever, use compile.el (I prefer to compile outside Emacs and search for
> bugs the old way). Also, I compare sources with a visual tool and then
> go to Emacs to edit, if needed. In these cases, M-x goto-line is very
> useful (in fact, I bound it to H-S-left long time ago).

I suggest you try "emacsclient -n +5 path/to/file" (of course, I've
got the alias "ec" for "emacsclient").  If you're not working in
Emacs all the time, this is a major gain -- you need not switch
between windows or even workspaces while entering a line number, and
you can look at it while you're typing it (with lots of numbers on the
screen, I find it much easier to mechanically type, instead of trying
to remember a number and enter it in Emacs directly).

This way is much better -- terminal already has the right context
(i.e. more suitable cwd), so you need not search the filename by full
path in Emacs, or switch between buffers -- you've got all the data
you need at your sight. (Of course, if the file is already opened in
a buffer, emacsclient simply Does The Right Thing.)

With all this, I rarely if ever need to use M-x goto-line.  For those
that are not willing to go the "better" path (of course, if it becomes
a consensus that this is actually "better", I'm not insisting this
is), they can always customize their keybindings. 

For "average joe", we want to make them learn the better way.

With the examples you mentioned, it seems that you haven't made use
of emacsclient so far; I recommend it, since it's been my $EDITOR for
a long time. ;)

[There's one catch to all this though: (server-start), required by
emacsclient, is not run by default.]


reply via email to

[Prev in Thread] Current Thread [Next in Thread]