From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Floyd Davidson Newsgroups: gmane.emacs.help Subject: Re: Newbie: Interactive goto-line ?! Date: Wed, 25 Feb 2004 07:29:29 -0900 Organization: __________ Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87ptc3nmvq.fld@barrow.com> References: <403b2dbe$0$38285$e4fe514c@dreader14.news.xs4all.nl> <874qtgqq9w.fld@barrow.com> <403BBB98.5030506@yahoo.com> <877jycoxo4.fld@barrow.com> <87y8qroejs.fld@barrow.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1077727002 1781 80.91.224.253 (25 Feb 2004 16:36:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 25 Feb 2004 16:36:42 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 25 17:36:21 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Aw21F-0007Oj-00 for ; Wed, 25 Feb 2004 17:36:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1Aw1y9-0007ME-QW for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Feb 2004 11:33:09 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!cyclone.bc.net!HSNX.atgi.net!falcon.america.net!eagle.america.net.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: gnus 5.10.6/XEmacs 21.4.15/Linux 2.6.0 Cancel-Lock: sha1:qrSVfBZtzYhFZjjyVUQw+9U+KVU= Original-Lines: 114 Original-NNTP-Posting-Host: 209.124.156.115 Original-X-Trace: eagle.america.net 1077726618 209.124.156.115 (Wed, 25 Feb 2004 11:30:18 EST) Original-NNTP-Posting-Date: Wed, 25 Feb 2004 11:30:18 EST Original-Xref: shelby.stanford.edu gnu.emacs.help:121252 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:17205 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:17205 Eli Zaretskii wrote: >> From: Floyd Davidson >> > >> >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 Ukpeagvik (Barrow, Alaska) floyd@barrow.com