help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: equivalent of make-local-variable for defun?


From: Barry Margolin
Subject: Re: equivalent of make-local-variable for defun?
Date: Mon, 03 Nov 2008 20:47:08 -0500
User-agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)

In article 
<1d3363bf-4c06-4424-832a-5abe06f560a0@z6g2000pre.googlegroups.com>,
 jrwats <jrwats@gmail.com> wrote:

> I'm trying to fix a mode using comint for an inferior lisp that
> apparently needs to overwrite  comint-send-region.  I'd rather it not
> 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.  If it's in a buffer that 
needs your fix, it runs the advice, otherwise it falls through to the 
regular function.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***


reply via email to

[Prev in Thread] Current Thread [Next in Thread]