From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sebastian Wiesner Newsgroups: gmane.emacs.devel Subject: Re: Derived modes and mode hooks Date: Sat, 9 Mar 2013 20:49:13 +0100 Message-ID: References: <836210y156.fsf@gnu.org> <831uboxy0r.fsf@gnu.org> <83wqtgwesb.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1362858576 25000 80.91.229.3 (9 Mar 2013 19:49:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 Mar 2013 19:49:36 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 09 20:49:58 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UEPmG-0004d1-Lr for ged-emacs-devel@m.gmane.org; Sat, 09 Mar 2013 20:49:56 +0100 Original-Received: from localhost ([::1]:34130 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEPlu-00043i-8T for ged-emacs-devel@m.gmane.org; Sat, 09 Mar 2013 14:49:34 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:51408) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEPln-00043T-7j for emacs-devel@gnu.org; Sat, 09 Mar 2013 14:49:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UEPlh-0000na-5z for emacs-devel@gnu.org; Sat, 09 Mar 2013 14:49:27 -0500 Original-Received: from mail-qe0-f43.google.com ([209.85.128.43]:51104) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEPla-0000mH-Ee; Sat, 09 Mar 2013 14:49:14 -0500 Original-Received: by mail-qe0-f43.google.com with SMTP id 1so1647925qee.16 for ; Sat, 09 Mar 2013 11:49:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=e0GDQwLQTsn13kzIDet/py/m4wjJ9az6S14wmNsbpRs=; b=HV6da0t4SPT4mJZWEV2bw/1xKzREsDKlzngyBzpdLkI+bHGVKsMmRkLbotM/KqwjAi lQL2ydc6bk0oFe6Zmkm1afo1AHBpEg8cwv++OxF8KE6peYDNrc4x45+iFmmEdVAjkZ0A E+oQj+c7IT8Jyyl+4jmJUCvFFO5oL6tVt+0mlG6Yyd10RwtSd+u/haXQZ0SMYaU53teX Xv+rJ8Lx8ef+GzF+L3ewy1QIZsOOrfCvHehCe4/r5kfdZwM3bKb6h2V6/lIgp3KqJNvY g0jFo216ctUX+x69UFZjMyxfkKHrxeM6MSH7vAbGUTX+Wx3KlpROPzGoT96iY2i4JlXu PrtQ== X-Received: by 10.224.31.73 with SMTP id x9mr10302817qac.11.1362858553776; Sat, 09 Mar 2013 11:49:13 -0800 (PST) Original-Received: by 10.224.111.147 with HTTP; Sat, 9 Mar 2013 11:49:13 -0800 (PST) In-Reply-To: <83wqtgwesb.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.128.43 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:157678 Archived-At: 2013/3/9 Eli Zaretskii : >> Date: Sat, 9 Mar 2013 19:58:11 +0100 >> From: Sebastian Wiesner >> Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org >> >> 2013/3/9 Eli Zaretskii : >> >> In order to completely disable automatic filling I'd add a function >> >> which simply returns t to this list? >> > >> > That's one possibility; I'm sure there are others, less radical ones. >> > >> >> That sounds like a nasty hack to me. >> > >> > I don't see why. It is certainly not as nasty as overriding user >> > customizations. >> >> So your proposed solution effectively inhibits auto filling and thus >> also *effectively overrides* the user's customization, but in a >> convoluted way, abusing a variable which is obviously intended for a >> different purpose, and which most likely only few users even know >> about. >> >> Yet you actually *prefer* this crude way of effectively overriding the >> user's customization over simply disabling the mode, *the* obvious way >> of inhibiting auto filling, more over clearly indicated to the user by >> the absence of the corresponding entry in the mode line. >> >> Did I get that correctly? > > No. I did say I'm sure there are less radical ways of doing this, > didn't I? Truly, you said so, yet the only less radical (or say, less convoluted way) I see is simply disabling the mode, which I thought you were opposing. However, we obviously misunderstood each other, see below. >> I hitherto thought the main point of derived modes was simply to allow >> re-use of code > > Reuse doesn't make sense if you need to disable most of the inherited > code. I don't indent do that. > In any case, you misunderstand what I meant: I meant not to modify the > hook itself. It is okay to make the same effect in other ways. I never meant to modify the hook itself. I agree that this is a total no-go. I merely intend to disable a specific minor mode (i.e. auto-fill-mode) in a specific major mode derived from text mode, for good reasons. I tried to do that in the body of the derived mode, only to discover that all hooks are run *after* the evaluation of the body, making my attempt pointless in face of the common way of enabling auto-fill-mode by adding it to text-mode-hook. Hence my initial mail. However, I see that there is no reasonable way to achieve this, so I'll simply tell my users to do so. Not as convenient as I had wished, but apparently the only reasonable way.