From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: occur-mode-hook run too early to be useful Date: Wed, 28 Aug 2002 17:06:20 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <20020828164804.A71C.LEKTU@terra.es> References: <20020828103157.9D0E.LEKTU@terra.es> <200208281430.g7SEU5Z04025@rum.cs.yale.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1030547309 26657 127.0.0.1 (28 Aug 2002 15:08:29 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 28 Aug 2002 15:08:29 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17k4Qi-0006vb-00 for ; Wed, 28 Aug 2002 17:08:24 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17k4wY-0006r4-00 for ; Wed, 28 Aug 2002 17:41:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17k4S4-00058m-00; Wed, 28 Aug 2002 11:09:48 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17k4Pc-0004R9-00 for emacs-devel@gnu.org; Wed, 28 Aug 2002 11:07:16 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17k4P1-0004L6-00 for emacs-devel@gnu.org; Wed, 28 Aug 2002 11:07:15 -0400 Original-Received: from [62.22.27.141] (helo=mail.peoplecall.com) by monty-python.gnu.org with esmtp (Exim 4.10) id 17k4P0-0004KE-00 for emacs-devel@gnu.org; Wed, 28 Aug 2002 11:06:38 -0400 Original-Received: from [62.22.27.143] (jbarranquero.ofi.peoplecall.com [62.22.27.143]) by mail.peoplecall.com (8.11.6/8.11.6) with ESMTP id g7SF6KB32615; Wed, 28 Aug 2002 17:06:20 +0200 Original-To: "Stefan Monnier" In-Reply-To: <200208281430.g7SEU5Z04025@rum.cs.yale.edu> X-Mailer: Becky! ver. 2.05.04 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:7060 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:7060 On Wed, 28 Aug 2002 10:30:05 -0400, "Stefan Monnier" wrote: > That would be wrong. The hook should be run at the end of the major mode's > function. Yes, sure. That's the normal way and that's why I asked. But in this case things aren't that clear, as the distinction between code in occur-mode and code in occur-1 seems rather arbitrary: 1. occur-mode is only called from occur-1 2. occur-mode is called unconditionally 3. occur-1 is the engine to all the interactive occur functions 4. M-x occur-mode in a non-occur buffer is meaningless 5. occur-mode-hook now serves almost no practical purpose > Another way would be to call `occur-mode' later (which would > require the occur-revert-arguments variable to be made permanent-local) That just does credence to my idea that occur-mode is but an ugly artifact. > or to provide another hook (like `occur-hook'). Yeah, of course. But it feels a bit silly to have two hooks for almost nothing. In fact, if I add an `occur-hook' I could move the call to `turn-on-font-lock' to it and `occur-mode-hook' would be useless... Not to mention that its docstring just says "Hooks run when `occur' is called.", so it's difficult, from a user's POV, to see what purpose it serves that occur-hook does not. So I think that's what I'm going to do: changing occur-mode-hook to just occur-hook and executing it at the end of occur-1. Thanks for your comments, /L/e/k/t/u