From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: called by a process filter? Date: Thu, 12 May 2005 15:58:17 +0200 Message-ID: References: <87hdh81srh.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1115906576 21108 80.91.229.2 (12 May 2005 14:02:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 12 May 2005 14:02:56 +0000 (UTC) Cc: Kevin Rodgers , rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 12 16:02:46 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DWE9K-0007Da-QA for ged-emacs-devel@m.gmane.org; Thu, 12 May 2005 15:54:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DWEIH-00011e-Pz for ged-emacs-devel@m.gmane.org; Thu, 12 May 2005 10:04:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DWEHu-0000wW-Ip for emacs-devel@gnu.org; Thu, 12 May 2005 10:03:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DWEHs-0000vX-MZ for emacs-devel@gnu.org; Thu, 12 May 2005 10:03:41 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DWEHs-0000uH-2c for emacs-devel@gnu.org; Thu, 12 May 2005 10:03:40 -0400 Original-Received: from [212.88.64.25] (helo=mail-relay.sonofon.dk) by monty-python.gnu.org with smtp (Exim 4.34) id 1DWEJG-0002iz-FL for emacs-devel@gnu.org; Thu, 12 May 2005 10:05:06 -0400 Original-Received: (qmail 56612 invoked from network); 12 May 2005 13:58:12 -0000 Original-Received: from unknown (HELO kfs-l.imdomain.dk.cua.dk) (213.83.150.2) by 0 with SMTP; 12 May 2005 13:58:12 -0000 Original-To: Stefan Monnier In-Reply-To: <87hdh81srh.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Thu, 12 May 2005 09:32:24 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:37035 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37035 Stefan Monnier writes: >> Doesn't the following work? > >> (defvar in-my-filter-p nil) > >> (defun my-filter (proc text) >> (let ((in-my-filter-p t)) >> ...)) > >> (defun my-after-change-function () >> (if in-my-filter-p >> ... > > No, because the after-change-function is generic I would expect it to be buffer local, and as such, it would only be triggered by filter functions that update that buffer. > and doesn't know about all > the various filter functions it might interact with (which it'd have to > tweak with defadvice in order to do what you suggest). Of course, if the after-change-function _is_ generic, that would be necessary. > > My guess is that after-change-function is the wrong place to do what the OP > wants to do. It does indeed seem odd that the after-change-function need to know what command made the change... -- Kim F. Storm http://www.cua.dk