From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lawrence Mitchell Newsgroups: gmane.emacs.devel,gmane.emacs.erc.general Subject: Re: `comint-exec-hook'-like feature for erc? Date: Fri, 23 Jun 2006 22:33:11 +0100 Organization: funfunfun Message-ID: References: <20060623153206.3DA388197@planetmath.cc.vt.edu> <87d5cz68yv.fsf@tuxtanker.mwolson.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1151098432 4288 80.91.229.2 (23 Jun 2006 21:33:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 23 Jun 2006 21:33:52 +0000 (UTC) Cc: erc-discuss@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 23 23:33:51 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FttHd-0006n2-5I for ged-emacs-devel@m.gmane.org; Fri, 23 Jun 2006 23:33:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FttHc-0002GE-N3 for ged-emacs-devel@m.gmane.org; Fri, 23 Jun 2006 17:33:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FttHP-0002Ff-N7 for emacs-devel@gnu.org; Fri, 23 Jun 2006 17:33:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FttHN-0002Em-6y for emacs-devel@gnu.org; Fri, 23 Jun 2006 17:33:30 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FttHN-0002Ej-43 for emacs-devel@gnu.org; Fri, 23 Jun 2006 17:33:29 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FttSe-0005v4-IE for emacs-devel@gnu.org; Fri, 23 Jun 2006 17:45:08 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FttHG-0006iA-HL for emacs-devel@gnu.org; Fri, 23 Jun 2006 23:33:22 +0200 Original-Received: from host-84-9-233-188.bulldogdsl.com ([84.9.233.188]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Jun 2006 23:33:22 +0200 Original-Received: from wence by host-84-9-233-188.bulldogdsl.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Jun 2006 23:33:22 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-To: emacs-devel@gnu.org Original-Followup-To: gmane.emacs.erc.general Original-Lines: 45 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: host-84-9-233-188.bulldogdsl.com Mail-Copies-To: nobody User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) Cancel-Lock: sha1:25pOB+egKxk6bdQujCdtjkuf23A= 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:56132 gmane.emacs.erc.general:876 Archived-At: Michael Olson wrote: > Joe Corneli writes: >> Is there (or should there be) a `comint-exec-hook'-like feature that >> runs after text has appeared in an ERC buffer (i.e. text that has been >> put there by anyone)? I would personally find this useful, and did >> not see find such a hook in the code. There is an >> `erc-send-completed-hook', but this only applies to text that >> originated locally. > One of the following hooks will do what you want, depending on whether > you want the hook to trigger before, after, or during ERC's auxiliary > text display functions (button highlighting, timestamps, et al). > erc-insert-modify-hook > Variable: Insertion hook for functions that will change the > text's appearance. ... > erc-insert-post-hook > Variable: This hook is called just after > `erc-insert-modify-hook'. ... > erc-insert-pre-hook > Variable: Hook called first when some text is inserted > through `erc-display-line'. ... Note that these /don't/ get run (as far as I can recall) for text that we send ourselves, only for text that we receive. Input that we send to the server is sent with erc-send-input and inserted with erc-display-msg (rather than erc-display-line). As such, the relevant hooks that are run are erc-send-{modify,post,pre}-hook. At some point (many moons ago) I proposed dealing with input we send in the exact same way (as far as buffer display went) as the stuff we received from the remote server. Unfortunately, roundtoits never appeared at the time, and then I didn't really think about it again. Lawrence (still alive, but not really ircing much any more) -- Lawrence Mitchell