From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Derived modes and mode hooks Date: Sun, 10 Mar 2013 00:53:04 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1362894789 29040 80.91.229.3 (10 Mar 2013 05:53:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Mar 2013 05:53:09 +0000 (UTC) Cc: emacs-devel To: Sebastian Wiesner Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 10 06:53:34 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 1UEZCO-0001s0-5A for ged-emacs-devel@m.gmane.org; Sun, 10 Mar 2013 06:53:32 +0100 Original-Received: from localhost ([::1]:42685 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEZC2-00010g-4z for ged-emacs-devel@m.gmane.org; Sun, 10 Mar 2013 00:53:10 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43853) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEZBy-00010O-Ui for emacs-devel@gnu.org; Sun, 10 Mar 2013 00:53:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UEZBx-0007km-Tx for emacs-devel@gnu.org; Sun, 10 Mar 2013 00:53:06 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:34956) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEZBx-0007kg-PO for emacs-devel@gnu.org; Sun, 10 Mar 2013 00:53:05 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFsoXZ8/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJIgeBsEtkQoDiGGJeZIggV6DFQ X-IPAS-Result: Av4EABK/CFFsoXZ8/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJIgeBsEtkQoDiGGJeZIggV6DFQ X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="3650807" Original-Received: from 108-161-118-124.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([108.161.118.124]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 10 Mar 2013 00:53:03 -0500 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 6AC64AE18E; Sun, 10 Mar 2013 00:53:04 -0500 (EST) In-Reply-To: (Sebastian Wiesner's message of "Sat, 9 Mar 2013 17:25:09 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 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:157683 Archived-At: > To give a concrete example for such a case: The phpbb forum software > translates line breaks in the BB Code markup of posts into line breaks > in the HTML rendering, i.e. line breaks in the markup of a posting > directly affect its visual representation. Hence, automatic filling > is a no-go, and I want to disable by default in this mode, even if the > user has enabled it generically by the common way of adding it to > "text-mode-hook". Yes, that's unfortunate. You're going to need to be inventive in order to reconcile the fact that you want to derive from text-mode while at the same time writing a mode that behaves differently from what text-mode expects. Eli's suggestion might work, tho it's admittedly crude. Maybe you can set normal-auto-fill-function buffer-locally. Or you can set auto-fill-mode-hook buffer-locally. Or you can set the fill-column to a very large number. Or (as mentioned) you can set phpbb-mode-hook's default to disable auto-fill-mode. There are probably other options. Stefan