help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Newbie: Interactive goto-line ?!


From: Floyd Davidson
Subject: Re: Newbie: Interactive goto-line ?!
Date: Wed, 25 Feb 2004 07:29:29 -0900
User-agent: gnus 5.10.6/XEmacs 21.4.15/Linux 2.6.0

Eli Zaretskii <address@hidden> wrote:
>> From: Floyd Davidson <address@hidden>
>> >
>> >For example, "M-g M-g" is invaluable as a means to fix bad
>> >font-lock fontifications (a.k.a. syntax highlighting).
>>
>> That is not a default binding for either GNU Emacs or XEmacs, so
>> I'm not positive which function you have bound to it.
>
>Did you try "C-h c M-g M-g"?  In my Emacs it says
>
>   M-g M-g runs the command font-lock-fontify-block

Run Emacs with the -q option.  At least in the latest Emacs
release (21.3.1) that won't be defined.  You can then do C-h b,
mark the whole buffer, and pipe it through grep to find what
exactly is defined.

  M-g d         facemenu-set-default
  M-g b         facemenu-set-bold
  M-g i         facemenu-set-italic
  M-g l         facemenu-set-bold-italic
  M-g u         facemenu-set-underline
  M-g o         facemenu-set-faceq

If you then load the font-lock package, the following are added,

  M-g ESC       Prefix Command
  M-g ESC g     font-lock-fontify-block

For my style of use, none of those needs to have key bindings.
The only one that I would ever consider using is the font-lock
command, and since my need to use it is very rare, I've made
that (actually, font-lock-fontify-buffer) a menu option so
that it neither clutters my mind nor wastes a useful key binding.

Of course, /your/ needs might be very different.

>AFAICS, this is the default binding of GNU Emacs since Emacs 20.x at
>least (couldn't check in Emacs 19 where I'm typing this).

 GNU Emacs 21.3.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)

>> Incidentally, with XEmacs the default binding for M-g is the
>> goto-line function.
>
>Yes, we considered this during development of Emacs 20.1 and rejected
>this binding, since M-g is a prefix of commands that change fonts and
>text properties like bold, underlined, etc.

So you were aware all along that it is not uncontroversial.  In
fact, at some point in history it was changed to make it that
prefix rather than the default goto-line that XEmacs and others
bind to it.  With all due respect, a lot of people clearly
believe that first change was the mistake; and just as clearly
if they do it is because they think goto-line is a useful
function.  Ergo, your statement that it isn't goes against the
grain of a widely held belief.  Six of one, half a dozen of
another!

(Your mistake was say that it isn't for anyone.  You should
merely have pointed out that it isn't useful to *you*.)

>> >If you find yourself using goto-line too often, you should take a good
>> >look at the way you use Emacs: most uses of goto-line should be
>> >unnecessary because Emacs interface with various programs that report
>> >line numbers, such as compilers, Grep, etc., have commands to
>> >automatically visit the file and line number being reported.
>>
>> If you are not using goto-line you are missing a very quick way
>> to move around in files.
>
>I was serious.  If you have serious counter-arguments why goto-line is
>better then "C-x `" and its ilk, please tell.

But I did not say any such thing.

I said that if you aren't using it, you are missing out on a
quick way to move around in files.  When other methods are
quicker, they should be used.

Let me be a little more succinct.  Your statement that if I use
goto-line then I'm not using emacs well, because goto-line should
be unnecessary, is both /arrogant/ and /ignorant/.

I suggest we drop this part of the discussion because it is
abjectly silly to assume that your usage is the one true way.
It *is* appropriate to explain to someone how you happen to use
it, as an example they might find helpful.

_To_ _suggest_ _that_ _someone_ _else's_ _example_ _of_ _use_ _is_ _wrong_ _is_
_not_ _acceptable_.

>In a nutshell, the reason why goto-line should not be a frequently
>used command is that normally there's no reason to want to get to line
>number N unless you have a program that told you there's something
>interesting on that line.

Perhaps you do not use Emacs enough or in ways that don't
provide you with sufficient examples.  What you've left out of
your equation is temporal effect.  If the
compiler/grep/emacs/other-utility gave you a number, and you
then proceed to do a variety of useful things for *any* period
of time, be it 1 second or 10 days, the availability of that
number in that way is diminished, if not entirely gone.  The
question, if that number then becomes useful, is which way is
easiest to reproduce it for Emacs.  *You* might want to
re-compile something to get it, but I'll just use the goto-line
function, because for me, though maybe not for you, that is
indeed much faster.

--
Floyd L. Davidson           <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska)                         address@hidden


reply via email to

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