From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: with-wrapper-hook is obsolete; how to replace it? Date: Sun, 15 May 2016 14:43:59 -0400 Message-ID: References: <5738AB51.8030401@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1463420469 25914 80.91.229.3 (16 May 2016 17:41:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 16 May 2016 17:41:09 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 16 19:40:56 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b2MVW-0006st-RG for ged-emacs-devel@m.gmane.org; Mon, 16 May 2016 19:40:42 +0200 Original-Received: from localhost ([::1]:45430 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2MVW-0000bT-9e for ged-emacs-devel@m.gmane.org; Mon, 16 May 2016 13:40:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54078) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2MVJ-0000Zn-V4 for emacs-devel@gnu.org; Mon, 16 May 2016 13:40:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2MVG-00032N-GA for emacs-devel@gnu.org; Mon, 16 May 2016 13:40:29 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:35863) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2MVG-00032E-88 for emacs-devel@gnu.org; Mon, 16 May 2016 13:40:26 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1b210Y-0005Ab-0b for emacs-devel@gnu.org; Sun, 15 May 2016 20:43:18 +0200 Original-Received: from 45.72.245.134 ([45.72.245.134]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 15 May 2016 20:43:17 +0200 Original-Received: from monnier by 45.72.245.134 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 15 May 2016 20:43:17 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 15 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 45.72.245.134 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cancel-Lock: sha1:EutXqpzy6rEZ3VJ4rgZ+Po6QBZU= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:203859 Archived-At: > How do I alter the code to use add-function instead? > It's not immediately obvious. That is, if there is source code like this: I don't think you can do it in a backward-compatible way. Which is why buffer-substring--filter still uses with-wrapper-hook (but only to implement the obsolete filter-buffer-substring-functions variable). > then what should I replace the source code with? The replacement is that instead of using add-hook on filter-buffer-substring-functions, clients should now use add-function on filter-buffer-substring-function. Stefan