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 10:24:10 -0600 Message-ID: <29DD542E-257A-4D4A-B673-134186706B12@gmail.com> References: <8738mo7w0j.fsf@gmail.com> <87y54g5cd6.fsf@gmail.com> <6F68AA38-BFEF-4B6B-BE9B-105A22359891@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=_A8B7CDCC-912C-43E3-A563-158E147EEFC6"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Trace: ger.gmane.org 1385223873 15035 80.91.229.3 (23 Nov 2013 16:24:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Nov 2013 16:24:33 +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 17:24:37 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 1VkG0a-0002KX-Sv for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Nov 2013 17:24:37 +0100 Original-Received: from localhost ([::1]:44258 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkG0a-0001EA-EF for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Nov 2013 11:24:36 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59928) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkG0J-0001AM-Nf for help-gnu-emacs@gnu.org; Sat, 23 Nov 2013 11:24:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VkG0E-0005RH-C7 for help-gnu-emacs@gnu.org; Sat, 23 Nov 2013 11:24:19 -0500 Original-Received: from mail-ie0-x22b.google.com ([2607:f8b0:4001:c03::22b]:55287) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkG0E-0005RD-6b for help-gnu-emacs@gnu.org; Sat, 23 Nov 2013 11:24:14 -0500 Original-Received: by mail-ie0-f171.google.com with SMTP id ar20so4197613iec.16 for ; Sat, 23 Nov 2013 08:24:13 -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=SMKe1EzVBHXc8U1m25RstGKDQNsgUjRvX/qJG3cGY0U=; b=uz9Hkkx/ClwdmQJ5LlxTeKBCXzx5XthmCoj7eiVmg3goathWW+UYoXKSS3A5vBuSGB cS8ozpd8H30JE4Lwk1gKPPLsEv/4MO9HiPWjs48PVVXE0q0W1ChKxWtM8q+g27vmsauu HuNJc83aerP7gqCqXGUF39WXAs5aT62gYLBLiEVHtxm6V3zIqigji3LwZZlroYfc1lY/ CgMSooB3u413T5tkFHrPbSiRy5C4SDInc69VW9UwgOYtcN+QO4698kEinz5D5jdlwZHm lxUK7IRVPKLnpkqicozTUItqa3/4sHPNs/mR30CDpppkN6bVy9HDi8zi6ISD8CtYNIc1 n5eA== X-Received: by 10.43.172.4 with SMTP id nw4mr11818458icc.25.1385223853669; Sat, 23 Nov 2013 08:24:13 -0800 (PST) Original-Received: from magicbook.local ([64.128.19.234]) by mx.google.com with ESMTPSA id u1sm15175013ige.1.2013.11.23.08.24.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 23 Nov 2013 08:24:12 -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::22b 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:94588 Archived-At: --Apple-Mail=_A8B7CDCC-912C-43E3-A563-158E147EEFC6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Nov 23, 2013, at 9:38 AM, Stefan Monnier = wrote: >> (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))) >=20 >> How about an extra blurb in the documentation for = make-variable-buffer-local >=20 > Which documentation? The Elisp manual talks about it, as well as = about > the `permanant-local' property, which you might like to use. I was thinking about this documentation: > make-variable-buffer-local is an interactive built-in function in `C > source code'. >=20 > (make-variable-buffer-local VARIABLE) >=20 > Make VARIABLE become buffer-local whenever it is set. > At any time, the value for the current buffer is in effect, > unless the variable has never been set in this buffer, > in which case the default value is in effect. > Note that binding the variable with `let', or setting it while > a `let'-style binding made in this buffer is in effect, > does not make the variable buffer-local. Return VARIABLE. >=20 > In most cases it is better to use `make-local-variable', > which makes a variable local in just one buffer. >=20 > The function `default-value' gets the default value and `set-default' = sets it. I see permanent-local is mentioned in kill-all-local-variables but I = don't know to go to that documentation. I generally use describe-function and describe-variable inside emacs and rarely go to the elisp manual although I was using it for help with advice the past few days. I view the elisp manual as a "book" and go there to read up on entire topics but if I *think* I know what I'm doing, I don't use it. Perhaps = I need to change that habit. Perry --Apple-Mail=_A8B7CDCC-912C-43E3-A563-158E147EEFC6 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 iQEcBAEBAgAGBQJSkNaqAAoJEIPoMwNgGirl7vQH/i8hSnTZTwtr7s288TK+mXnI 61ahgSs7Y1Y561D5l88nwRtqI0ziSmOfBWDURvou62EsYuJ4C1suWUq514BKGjmH JJn+8f9QtphL7IYvQ4D1W3ZvgRHxKpjDt6gPpNi8pI+NNLMiyzOtuyJ5Idbc4cuX AeF+cdYDQ+b2WgDoUXgaqUUA527fyvVVI7TuiexEPET4Z/Nfb4Efkpz85JzkdLw7 CdtQl9qtp7phsd9CRpss7VgoCiox4PTMiRP1c0Slwb2FGnYKxmjb1/SSCd7b4VQD 6loJ52UEk6Ft+ZJwcL9heikFldOjyWYBDnIZT65i4eMIUvHILhPSU//Ib/F2Kds= =T4OV -----END PGP SIGNATURE----- --Apple-Mail=_A8B7CDCC-912C-43E3-A563-158E147EEFC6--