From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: jrwats Newsgroups: gmane.emacs.help Subject: Re: equivalent of make-local-variable for defun? Date: Mon, 3 Nov 2008 22:03:26 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <1d3363bf-4c06-4424-832a-5abe06f560a0@z6g2000pre.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1225781022 14259 80.91.229.12 (4 Nov 2008 06:43:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Nov 2008 06:43:42 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 04 07:44:44 2008 connect(): Connection refused Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from mail-forward1.uio.no ([129.240.10.70]) by lo.gmane.org with esmtp (Exim 4.50) id 1KxFec-0001a7-Qy for geh-help-gnu-emacs@m.gmane.org; Tue, 04 Nov 2008 07:44:42 +0100 Original-Received: from exim by mail-out1.uio.no with local-bsmtp (Exim 4.69) (envelope-from ) id 1KxFdW-0000F9-9y for geh-help-gnu-emacs@m.gmane.org; Tue, 04 Nov 2008 07:43:34 +0100 Original-Received: from mail-mx2.uio.no ([129.240.10.30]) by mail-out1.uio.no with esmtp (Exim 4.69) (envelope-from ) id 1KxFdW-0000F6-8f for geh-help-gnu-emacs@m.gmane.org; Tue, 04 Nov 2008 07:43:34 +0100 Original-Received: from lists.gnu.org ([199.232.76.165]) by mail-mx2.uio.no with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1KxFdV-0004e7-LL for geh-help-gnu-emacs@m.gmane.org; Tue, 04 Nov 2008 07:43:34 +0100 Original-Received: from localhost ([127.0.0.1]:53603 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KxFdU-0002cW-9x for geh-help-gnu-emacs@m.gmane.org; Tue, 04 Nov 2008 01:43:32 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!z6g2000pre.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 21 Original-NNTP-Posting-Host: 24.18.202.1 Original-X-Trace: posting.google.com 1225778606 30685 127.0.0.1 (4 Nov 2008 06:03:26 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 4 Nov 2008 06:03:26 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z6g2000pre.googlegroups.com; posting-host=24.18.202.1; posting-account=bFjqRgoAAAA1g2eFs8HouoaeO5EHoWR2 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.3) Gecko/2008092510 Ubuntu/8.04 (hardy) Firefox/3.0.3, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:164086 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org X-UiO-SPF-Received: Received-SPF: pass (mail-mx2.uio.no: domain of gnu.org designates 199.232.76.165 as permitted sender) client-ip=199.232.76.165; envelope-from=help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org; helo=lists.gnu.org; X-UiO-Spam-info: not spam, SpamAssassin (score=-4.0, required=5.0, autolearn=disabled, MISSING_SUBJECT=0.001,NO_RECEIVED=-0.001,RCVD_IN_DNSWL_MED=-4, uiobl=NO, uiouri=NO) X-UiO-Scanned: 1E7EA87BABD85FE8B2AB2D13ED97E516B9207D1C X-UiO-SPAM-Test: remote_host: 199.232.76.165 spam_score: -39 maxlevel 200 minaction 2 bait 0 mail/h: 14 total 75642 max/h 424 blacklist 0 greylist 0 ratelimit 0 Xref: news.gmane.org gmane.emacs.help:59422 Archived-At: On Nov 3, 5:47=A0pm, Barry Margolin wrote: > In article > <1d3363bf-4c06-4424-832a-5abe06f56...@z6g2000pre.googlegroups.com>, > > =A0jrwats wrote: > > I'm trying to fix a mode using comint for an inferior lisp that > > apparently needs to overwrite =A0comint-send-region. =A0I'd rather it n= ot > > overwrite ALL buffers' (including my shell-mode buffer) comint-send- > > region function. > > > Is there a way to define a function but local to the current buffer as > > when you define a local variable in make-local-variable? > > You could define around-advice on the function that checks the mode, or > looks at the value of a buffer-local variable. =A0If it's in a buffer tha= t > needs your fix, it runs the advice, otherwise it falls through to the > regular function. Thanks! This will work. It seems hackish, but it will work!