From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tianxiang Xiong Newsgroups: gmane.emacs.devel Subject: [PATCH] Add `advice-remove-all` Date: Wed, 26 Apr 2017 20:23:31 -0700 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a114fa8c63730ae054e1d7b8c X-Trace: blaine.gmane.org 1493289813 26996 195.159.176.226 (27 Apr 2017 10:43:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 27 Apr 2017 10:43:33 +0000 (UTC) To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 27 12:43:29 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3gtF-000599-Re for ged-emacs-devel@m.gmane.org; Thu, 27 Apr 2017 12:43:13 +0200 Original-Received: from localhost ([::1]:58473 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3a2U-00060O-Il for ged-emacs-devel@m.gmane.org; Wed, 26 Apr 2017 23:24:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34847) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3a1n-0005yQ-2F for emacs-devel@gnu.org; Wed, 26 Apr 2017 23:23:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d3a1l-0008Dc-Iq for emacs-devel@gnu.org; Wed, 26 Apr 2017 23:23:35 -0400 Original-Received: from mail-yw0-x22a.google.com ([2607:f8b0:4002:c05::22a]:35294) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d3a1l-0008Cq-B5 for emacs-devel@gnu.org; Wed, 26 Apr 2017 23:23:33 -0400 Original-Received: by mail-yw0-x22a.google.com with SMTP id u70so9816694ywe.2 for ; Wed, 26 Apr 2017 20:23:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=gB7C5OxcX3A9lgX7DIriGg+H8kkJFoVdPMtjiUPG+j0=; b=qh3Vvo+jEbzaI/rTWsc5nd3xFxO8ZzJsRvrzo5PgLfkxW5IZ1V73TFPV6RHXdDw46C pGic3S+bS55UqvV/57/JIMEKXQHuM3S2ezpM3LkB5R9vgqAvoHQ4XpECkOP/K+1DhX0C tLkCqO4+/trReEj+G4vg7dHm9/aIRkVkbHczhZZvjrOLpMD1p3e9CX934uM3TbbSGreC mo/gJ348bBl0AHEwZGJeliJso2w+fQOKr+jgn9iUiobEe3+f6OZxlKnLRkDzWGqyIY1d 99TixulwCp+3AD8e4mno9TxqRU+n0umxB9x6fh9r3BhKnaF/fIgv/PGMnzPcE3JKFSk5 IFcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=gB7C5OxcX3A9lgX7DIriGg+H8kkJFoVdPMtjiUPG+j0=; b=VZIh4p/eQD9OwhmMkdF9qGwjlJU1PrhtilMJ8xVUPp6lyesJykAxMZDu2StJaHmgrC GRU6VJ/SY/Le3+9zmo88R0dAgfyfUJw1fL8TBBVIkNyr1ygcPvDTrJ6cNq2f59vp7qxb vP1qiNWWeQ0IAYlCyQ5BepQw0JO6xLIaMZIzfAVGQ42CoptiEQWgbTbTdO6vOW60XnaJ KPUi6Bhz8gpYzdtt/wb3Cz6hCprNthlQV56rT8vnz265H5BxcxYTHLxP/GXYJSdA0URo gXGn8RNAt8bUQH0UQJruek1Pi8f6t9aZ3eO7Vhn2qqmGCuOEYgGqTQYCzyfwm9c4X5C+ xbkQ== X-Gm-Message-State: AN3rC/4ZzbJN35knfARwAiUVAMKtVv61HwmrJaZEBFM1r7PKhEOJZnPm JkPOHyb+basNg616eBD4++4YnQwqww== X-Received: by 10.13.212.214 with SMTP id w205mr2644842ywd.118.1493263411778; Wed, 26 Apr 2017 20:23:31 -0700 (PDT) Original-Received: by 10.129.106.11 with HTTP; Wed, 26 Apr 2017 20:23:31 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4002:c05::22a 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:214332 Archived-At: --001a114fa8c63730ae054e1d7b8c Content-Type: multipart/alternative; boundary=001a114fa8c63730aa054e1d7b8a --001a114fa8c63730aa054e1d7b8a Content-Type: text/plain; charset=UTF-8 I recently had the need to remove all advice from a function I was playing around with, and was surprised to find that `advice-remove-all` did not exist. Others have had need of it as well, so it seems like a good candidate for inclusion in `nadvice.el`. The attached patch adds `advice-remove-all` to `nadvice.el`, using the implementation suggested by xuchungyang. --001a114fa8c63730aa054e1d7b8a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I recently had the need to remove all advice from a functi= on I was playing around with, and was surprised to find that `advice-remove= -all` did not exist.

Others have had ne= ed of it as well, so it seems like a good candidate for inclusion in `n= advice.el`.

The attached patch adds `advice-remove= -all` to `nadvice.el`, using the implementation suggested by xuchungyang.
--001a114fa8c63730aa054e1d7b8a-- --001a114fa8c63730ae054e1d7b8c Content-Type: text/x-patch; charset=US-ASCII; name="0001-Add-advice-remove-all.patch" Content-Disposition: attachment; filename="0001-Add-advice-remove-all.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_j1zuh2r60 RnJvbSBjZDAzNzhhMjQ5M2UzOTFiYTA1ODg5ZDk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