From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.help Subject: Re: Set variable in derived mode before running the parent mode function Date: Sun, 21 Jun 2015 12:24:34 +0000 Message-ID: References: <55743080.1090101@easy-emacs.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1434889510 7233 80.91.229.3 (21 Jun 2015 12:25:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 21 Jun 2015 12:25:10 +0000 (UTC) To: =?UTF-8?Q?Andreas_R=C3=B6hler?= , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jun 21 14:25:01 2015 Return-path: Envelope-to: geh-help-gnu-emacs@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 1Z6eJ3-0000cC-Dg for geh-help-gnu-emacs@m.gmane.org; Sun, 21 Jun 2015 14:25:01 +0200 Original-Received: from localhost ([::1]:36183 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6eJ2-00049P-IX for geh-help-gnu-emacs@m.gmane.org; Sun, 21 Jun 2015 08:25:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46198) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6eIr-00049F-Bg for help-gnu-emacs@gnu.org; Sun, 21 Jun 2015 08:24:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z6eIn-0004NG-If for help-gnu-emacs@gnu.org; Sun, 21 Jun 2015 08:24:49 -0400 Original-Received: from mail-wi0-x230.google.com ([2a00:1450:400c:c05::230]:38825) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6eIn-0004MT-7x for help-gnu-emacs@gnu.org; Sun, 21 Jun 2015 08:24:45 -0400 Original-Received: by wibdq8 with SMTP id dq8so52662169wib.1 for ; Sun, 21 Jun 2015 05:24:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-type; bh=dM+NINRaXrZ8+ksyxcD5zNcEV/UKUYTipmoYaKFeL9s=; b=hvs+sJ22JywVMF/7D2KljLnsalO89s5LYb5qiJ29gAeqM0DR6NimRiXlHnNLHerMNZ bca76kYbXP7XKOVj080iqYTflC8/Us6KxR0SyE+0a3ISM2LyS3GuhZ+fAqOYLHmU9iei R/64M0SKhjNlIpKJLbegUwSU+4/5BqWfuCcMnucc5BFE8ENetxbh71Ois91KNWletdzE FTlGuku5CJWXJr/yJ/TpEM+RcDasjFxT5J8lSdnMgNXp99g3vN+ThiqeAdMlt/uPdF6j 20KrPZv7HS7RkSjBER1U5aY7uHoGnyEzwr016G26fqfD/6m1OfE6XCeUYtBB+4Po15aF weaQ== X-Received: by 10.194.52.37 with SMTP id q5mr43186493wjo.122.1434889484660; Sun, 21 Jun 2015 05:24:44 -0700 (PDT) In-Reply-To: <55743080.1090101@easy-emacs.de> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::230 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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 Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:105058 Archived-At: Andreas R=C3=B6hler schrieb am So., 7. Juni= 2015 um 13:52 Uhr: > > Am 06.06.2015 um 17:58 schrieb Philipp Stephani: > > Stefan Monnier schrieb am Mi., 3. Juni 2015 > um > > 03:15 Uhr: > > > >>> `python-mode' are inappropriate for the derived mode; in particular, > I'd > >>> like to disable auto-guessing of the indentation by setting > >>> `python-indent-guess-indent-offset' to nil. However, > >>> `define-derived-mode' has no customization point for running code > before > >>> the parent mode function. What's the best way to solve this? > >> Add the code *after* running python-mode? After all, setting vars > >> before would be a waste since python-mode (like all other proper major > >> modes) begins by calling kill-all-local-variables (also known as > >> fundamental-mode). > >> > >> > >> > > You're right, that wouldn't work. The problem is that > > python-indent-guess-indent-offset prints a message if it couldn't guess > the > > indentation; I'd like to suppress that message. > > > Disabling a message is another thing than disabling auto-guessing. > > Look into python.el, definition of > > python-indent-guess-indent-offset > > Messaging is done from last line there. Put it at an extra line - i.e. a > new line at the end of "(message > " sexp. Than comment out that line. > > Sure, but that would disable the message for all users. I could totally live with that (Emacs is already too chatty), but Stefan would need to agree that it's fine to remove the message entirely.