From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Perry Smith Newsgroups: gmane.emacs.help Subject: Re: Help needed with defadvice Date: Sat, 23 Nov 2013 09:22:35 -0600 Message-ID: <6F68AA38-BFEF-4B6B-BE9B-105A22359891@gmail.com> References: <8738mo7w0j.fsf@gmail.com> <87y54g5cd6.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Content-Type: multipart/signed; boundary="Apple-Mail=_EB1F69B8-B6D5-4358-B9F7-89A5A895B1CE"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Trace: ger.gmane.org 1385220183 8965 80.91.229.3 (23 Nov 2013 15:23:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Nov 2013 15:23:03 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 23 16:23:08 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 1VkF33-0002FN-Oy for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Nov 2013 16:23:05 +0100 Original-Received: from localhost ([::1]:44070 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkF33-0005VH-BH for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Nov 2013 10:23:05 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkF2n-0005V8-1x for help-gnu-emacs@gnu.org; Sat, 23 Nov 2013 10:22:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VkF2h-0005RD-N9 for help-gnu-emacs@gnu.org; Sat, 23 Nov 2013 10:22:48 -0500 Original-Received: from mail-ie0-x230.google.com ([2607:f8b0:4001:c03::230]:40981) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkF2h-0005R6-HR for help-gnu-emacs@gnu.org; Sat, 23 Nov 2013 10:22:43 -0500 Original-Received: by mail-ie0-f176.google.com with SMTP id at1so3974551iec.7 for ; Sat, 23 Nov 2013 07:22:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=SOhcECrMyignhY3zcjeCLMOPSMfn2T1qnHdSlOTWPak=; b=LZpaQWc/yzlBo/0mo/aobnM2c2Ojg7PxYxkX3/fp5tvHofR5MM6s1gKnq48LgVsoGU o1Z7gDnVtK2iR042EYDzoJq+h16sJogX79pXn0MLlI4rJkuala3pus6/3qpu6/oPj9/w 75fX6A6YMEBm7DVe5p6oXf4zZuHdLSSXCWbg1PdM76NtRfqcpO72f8pSY/W6NpxNfSdz iTybCd743a0s4HsmkOZAoTmqeExp6JT8SjRXMiK1Ps6n4DtSgfpFn0WklOs6cHP2PUxE X0OxeNqEaZy6LPDxgo5KqlJGFFtmQeqNwX68av4gfn+0n1sZcOdJ8Mtus+WFmtft81UB znoA== X-Received: by 10.50.77.83 with SMTP id q19mr6658328igw.21.1385220162598; Sat, 23 Nov 2013 07:22:42 -0800 (PST) Original-Received: from magicbook.local ([64.128.19.234]) by mx.google.com with ESMTPSA id f5sm15569100igc.4.2013.11.23.07.22.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 23 Nov 2013 07:22:41 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.1510) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c03::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:94585 Archived-At: --Apple-Mail=_EB1F69B8-B6D5-4358-B9F7-89A5A895B1CE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Nov 23, 2013, at 8:48 AM, Stefan Monnier = wrote: >> (,(or parent 'kill-all-local-variables)) <<<<<<<<< > [...] >> Does anyone know why this is there? >=20 > Read the Elisp manual's description of what a major mode should do. > Buffer-local variables are (in their majority) specific a particular > major mode, hence they are reset when the major mode changes. Ok. Alex suggested a bug report. I guess I will hold off on that. I = have it written up ready to send. Let me know if you would prefer it sent or = not. I got around the issue with: (defadvice kill-all-local-variables (around inherit activate) "We want inherited variables to survive a call to this function" (let* ((set-list (mapcar (lambda ( v ) (cons v (symbol-value v))) inherited-alist))) ad-do-it (mapcar (lambda ( c ) (set (car c) (cdr c))) set-list))) How about an extra blurb in the documentation for = make-variable-buffer-local (and / or) make-local-variable that notes that they are usually killed = when entering a new mode? It was clear that someone was killing the = variables but it was hard for me to track down who it was. Thank you again to all who helped me out. Perry --Apple-Mail=_EB1F69B8-B6D5-4358-B9F7-89A5A895B1CE Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJSkMg7AAoJEIPoMwNgGirlESYH/RM4srnnRkyEXlmSNEuuG7+D 8td5wRL1OpttjrPDj4VPbKf3P+oMUeJOFgV94Q5nN280TEHzC23lHmK8Fs/n2GQz RBqStIUkkBZdHh2ClDmem0JJM+NghfGwdnljzGvJYQqfSBPG3BWU6wMbdyvPiHGA xs1eL2LT5hwIj0Nv8Pgj/c3gAGEoABTaBkvSU6/8AgENw4r2RifurMR44acFT35I WIa+tpNVVMmr5hAIjcFHLaS41cwywqDiCWu+vd5f0WWxkIeEbrmfZ57J0Bv2jXv3 52MvMZLvvMT/6Ncvhi+JkBjZay65Doo36ca0dvCunX2d01MIPSWJkNdVSlKqhdg= =jD6O -----END PGP SIGNATURE----- --Apple-Mail=_EB1F69B8-B6D5-4358-B9F7-89A5A895B1CE--