From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alex Kost Newsgroups: gmane.emacs.help Subject: Re: Help needed with defadvice Date: Sat, 23 Nov 2013 11:00:26 +0400 Message-ID: <878uwf4n79.fsf@gmail.com> References: <8738mo7w0j.fsf@gmail.com> <87y54g5cd6.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1385190056 9001 80.91.229.3 (23 Nov 2013 07:00:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Nov 2013 07:00:56 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org Help" To: Perry Smith Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 23 08:01:01 2013 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 1Vk7D8-0000Aw-VC for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Nov 2013 08:00:59 +0100 Original-Received: from localhost ([::1]:42588 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vk7D8-0006wM-6e for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Nov 2013 02:00:58 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vk7Cp-0006wG-5l for help-gnu-emacs@gnu.org; Sat, 23 Nov 2013 02:00:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vk7Cg-0005kh-OO for help-gnu-emacs@gnu.org; Sat, 23 Nov 2013 02:00:39 -0500 Original-Received: from mail-lb0-x230.google.com ([2a00:1450:4010:c04::230]:42113) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vk7Cg-0005kb-Co for help-gnu-emacs@gnu.org; Sat, 23 Nov 2013 02:00:30 -0500 Original-Received: by mail-lb0-f176.google.com with SMTP id x18so1718952lbi.35 for ; Fri, 22 Nov 2013 23:00:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=DIEar+2ddzJcOaobkYxTus9eL/+/01XiLADbC24dJzQ=; b=tJQp67xi2S7orX4D2crUj2hQicImLgFaqfZogqGj7kHgHJS2fVsnEfelCRXoBw8Qkc 4nE0vroCc+vgTSGzKGFJwxTVOalX6yrA4ZTsizY65aPqW8fu/x+1i1tU4ZRSf5I68w+X VbXRBMhJSaoGZMOKY4KqXRj3qHYYpvIQyNN98Ne+Cw+NJ1v7f2dhn6LlKz2nJOu8t8R5 L33S7UmiiRDqnJay5wjH6tQm0BFJknivynS7dqxTzK4hvYeljuOjl1qlDE+drP8B+LKE ybFL5ybAWL0NtI1E/s+VJ1gSIc/v0mVKNfCeqJKkI7r0l9QnKpZcp3RdtgbfEgA2mq41 Qw2A== X-Received: by 10.112.13.202 with SMTP id j10mr255440lbc.29.1385190029161; Fri, 22 Nov 2013 23:00:29 -0800 (PST) Original-Received: from leviafan (128-70-197-79.broadband.corbina.ru. [128.70.197.79]) by mx.google.com with ESMTPSA id j1sm12875763lbl.10.2013.11.22.23.00.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Nov 2013 23:00:28 -0800 (PST) In-Reply-To: (Perry Smith's message of "Fri, 22 Nov 2013 19:41:29 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::230 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:94578 Archived-At: Perry Smith (2013-11-23 05:41 +0400) wrote: > Thanks... I attacked this from the opposite direction adding debug trying to narrow down when the locals got killed. I finally bumped into these lines: > > (defmacro define-derived-mode (child parent name &optional docstring &rest body) > ... > (interactive) > ; Run the parent. > (delay-mode-hooks > > (,(or parent 'kill-all-local-variables)) <<<<<<<<< > ; Identify the child mode. > (setq major-mode (quote ,child)) > (setq mode-name ,name) > ...) > > I'm going to drive home and play with this some more but I predict that that is what is killing my local variables. > > Does anyone know why this is there? > > I somewhat assumed I had this in some of my poop but this is stock emacs code (24.3). As for me, i don't see a reason for killing local variables there. For example i have some local variables and after "M-x text-mode" they all die as text-mode is a derived-mode. This behaviour doesn't seem right to me. Will you "M-x report-emacs-bug" about it? (to clarify why that is there)