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: jrwats
Subject: Re: equivalent of make-local-variable for defun?
Date: Mon, 3 Nov 2008 22:03:26 -0800 (PST)
User-agent: G2/1.0

On Nov 3, 5:47 pm, Barry Margolin <bar...@alum.mit.edu> wrote:
> In article
> <1d3363bf-4c06-4424-832a-5abe06f56...@z6g2000pre.googlegroups.com>,
>
>  jrwats <jrw...@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.

Thanks!  This will work.  It seems hackish, but it will work!


reply via email to

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